]> 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:38:00 +0000 (16:38 -0500)
Fixes gh-1768
Closes gh-1569

build/tasks/build.js

index e1cf741183f4d20107faf7caa76ac0facf8594f8..481a4d8f7ae3af9e658a51e3579161ef91fc6d70 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 ) ) {