Build: Remove empty define({}) from build output

Fixes gh-1768
Closes gh-1569
This commit is contained in:
David Corbacho 2014-05-01 13:21:34 +03:00 committed by Dave Methvin
parent bfd5dab2c6
commit 2c1b556d98

View File

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