Corrected stripdefine grunt task to account for variable r.js output (some versions include an empty dependency array in a final define(), others don't)

This commit is contained in:
Stu Cox
2013-03-08 13:32:09 -06:00
parent a285518b7c
commit b466c5ed45

View File

@@ -172,7 +172,7 @@ module.exports = function( grunt ) {
// Strip define fn
grunt.registerMultiTask('stripdefine', "Strip define call from dist file", function() {
var mod = grunt.file.read( this.file.src[0] ).replace('define("modernizr-init",[], function(){});', '');
var mod = grunt.file.read( this.file.src[0] ).replace(/define\("modernizr-init",( \[\],)? function\(\){}\);/, '');
// Hack the prefix into place. Anything is way to big for something so small.
if ( modConfig && modConfig.classPrefix ) {