diff options
author | Timmy Willison <timmywillisn@gmail.com> | 2013-09-09 12:32:06 -0400 |
---|---|---|
committer | Timmy Willison <timmywillisn@gmail.com> | 2013-09-09 13:55:07 -0500 |
commit | d788010aa724f58090560e83c224d3d140814b51 (patch) | |
tree | db28f05ac2ddac5842d015b5b5ca4ccaf8762e4c /build/tasks | |
parent | 99191a510ecb5584addc0391edd56d626067b28a (diff) | |
download | jquery-d788010aa724f58090560e83c224d3d140814b51.tar.gz jquery-d788010aa724f58090560e83c224d3d140814b51.zip |
Don't keep semicolons if the require call is not a var declaration
Diffstat (limited to 'build/tasks')
-rw-r--r-- | build/tasks/build.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/build/tasks/build.js b/build/tasks/build.js index d8cea4c52..cf5fc9b6f 100644 --- a/build/tasks/build.js +++ b/build/tasks/build.js @@ -68,9 +68,9 @@ module.exports = function( grunt ) { // Remove CommonJS-style require calls // Keep an ending semicolon contents = contents - .replace( /(?:\s+\w+ = )?\s*require\(\s*(")[\w\.\/]+\1\s*\)([,;])/g, - function( all, quote, commaSemicolon ) { - return commaSemicolon === ";" ? ";" : ""; + .replace( /(\s+\w+ = )?\s*require\(\s*(")[\w\.\/]+\2\s*\)([,;])/g, + function( all, isVar, quote, commaSemicolon ) { + return isVar && commaSemicolon === ";" ? ";" : ""; }); // Remove empty definitions |