From 2c1b556d98da597b0490f204e3561f656987f17c Mon Sep 17 00:00:00 2001 From: David Corbacho Date: Thu, 1 May 2014 13:21:34 +0300 Subject: [PATCH] Build: Remove empty define({}) from build output Fixes gh-1768 Closes gh-1569 --- build/tasks/build.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/tasks/build.js b/build/tasks/build.js index e1cf74118..481a4d8f7 100644 --- a/build/tasks/build.js +++ b/build/tasks/build.js @@ -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 ) ) {