Skip to content
Permalink
Browse files

Don't keep semicolons if the require call is not a var declaration

  • Loading branch information...
timmywil committed Sep 9, 2013
1 parent 99191a5 commit d788010aa724f58090560e83c224d3d140814b51
Showing with 3 additions and 3 deletions.
  1. +3 −3 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

0 comments on commit d788010

Please sign in to comment.
You can’t perform that action at this time.