Skip to content

Commit 2138f15

Browse files
dcorbdmethvin
authored andcommitted
Build: Remove empty define({}) from build output
Fixes gh-1768 Closes gh-1569 (cherry picked from commit 2c1b556)
1 parent 404d2aa commit 2138f15

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

build/tasks/build.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ module.exports = function( grunt ) {
2020
optimize: "none",
2121
// Include dependencies loaded with require
2222
findNestedDependencies: true,
23+
// Avoid inserting define() placeholder
24+
skipModuleInsertion: true,
2325
// Avoid breaking semicolons inserted by r.js
2426
skipSemiColonInsertion: true,
2527
wrap: {
@@ -81,7 +83,7 @@ module.exports = function( grunt ) {
8183

8284
// Remove empty definitions
8385
contents = contents
84-
.replace( /define\(\[[^\]]+\]\)[\W\n]+$/, "" );
86+
.replace( /define\(\[[^\]]*\]\)[\W\n]+$/, "" );
8587
}
8688
// AMD Name
8789
if ( (amdName = grunt.option( "amd" )) != null && /^exports\/amd$/.test( name ) ) {

0 commit comments

Comments
 (0)