]> source.dussan.org Git - jquery.git/commitdiff
Build: Remove empty define({}) from build output
authorDavid Corbacho <davidcorbacho@gmail.com>
Thu, 1 May 2014 10:21:34 +0000 (13:21 +0300)
committerDave Methvin <dave.methvin@gmail.com>
Thu, 4 Dec 2014 21:48:28 +0000 (16:48 -0500)
Fixes gh-1768
Closes gh-1569
(cherry picked from commit 2c1b556d98da597b0490f204e3561f656987f17c)

build/tasks/build.js

index caec8f153c9576fed8f061189637969fc9bb13c5..199f78120b1bbead0c6788b17f8b27e633ffd8f2 100644 (file)
@@ -20,6 +20,8 @@ module.exports = function( grunt ) {
                        optimize: "none",
                        // Include dependencies loaded with require
                        findNestedDependencies: true,
+                       // Avoid inserting define() placeholder
+                       skipModuleInsertion: true,
                        // Avoid breaking semicolons inserted by r.js
                        skipSemiColonInsertion: true,
                        wrap: {
@@ -81,7 +83,7 @@ module.exports = function( grunt ) {
 
                        // Remove empty definitions
                        contents = contents
-                               .replace( /define\(\[[^\]]+\]\)[\W\n]+$/, "" );
+                               .replace( /define\(\[[^\]]*\]\)[\W\n]+$/, "" );
                }
                // AMD Name
                if ( (amdName = grunt.option( "amd" )) != null && /^exports\/amd$/.test( name ) ) {