aboutsummaryrefslogtreecommitdiffstats
path: root/build/tasks
diff options
context:
space:
mode:
authorTimmy Willison <timmywillisn@gmail.com>2013-09-09 12:32:06 -0400
committerTimmy Willison <timmywillisn@gmail.com>2013-09-09 12:32:13 -0400
commit6c573391121c61b6e3797005c0fa932ae94ef4d1 (patch)
treef2b6b0ba532574400327cf0eb1e0306819b0fdf6 /build/tasks
parent49cfcb9f3e3f2cb371bdde92facf1c69c2c11f58 (diff)
downloadjquery-6c573391121c61b6e3797005c0fa932ae94ef4d1.tar.gz
jquery-6c573391121c61b6e3797005c0fa932ae94ef4d1.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.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/build/tasks/build.js b/build/tasks/build.js
index 1714957fa..21779d80a 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