diff options
author | Timmy Willison <timmywillisn@gmail.com> | 2013-10-15 10:40:48 -0400 |
---|---|---|
committer | Timmy Willison <timmywillisn@gmail.com> | 2013-10-15 11:59:16 -0400 |
commit | 62900a9edbb5bb1f89916ff04cecd421b3f6f6e5 (patch) | |
tree | e6ec11b2d9f0dd0419639444e8ffe77749195277 /build | |
parent | 03dd51494f25b79afb817db4ba83f4fbf0d8a646 (diff) | |
download | jquery-62900a9edbb5bb1f89916ff04cecd421b3f6f6e5.tar.gz jquery-62900a9edbb5bb1f89916ff04cecd421b3f6f6e5.zip |
Fixes #14450. Remove CommonJS+AMD syntax.
- To keep file size unaffected, an extra pragma was added to build.js to remove certain lines when building with special comments.
Conflicts:
src/core.js
src/css.js
src/effects.js
src/event.js
src/manipulation.js
src/offset.js
Diffstat (limited to 'build')
-rw-r--r-- | build/tasks/build.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/build/tasks/build.js b/build/tasks/build.js index 8fde24be9..e329e45e8 100644 --- a/build/tasks/build.js +++ b/build/tasks/build.js @@ -69,13 +69,12 @@ module.exports = function( grunt ) { .replace( /define\([^{]*?{/, "" ) .replace( rdefineEnd, "" ); - // Remove CommonJS-style require calls - // Keep an ending semicolon + // Remove anything wrapped with + // /* ExcludeStart */ /* ExcludeEnd */ + // or a single line directly after a // BuildExclude comment contents = contents - .replace( /(\s+\w+ = )?\s*require\(\s*(")[\w\.\/]+\2\s*\)[\.\w]*([,;])/g, - function( all, isVar, quote, commaSemicolon ) { - return isVar && commaSemicolon === ";" ? ";" : ""; - }); + .replace( /\/\*\s*ExcludeStart\s*\*\/[\w\W]*?\/\*\s*ExcludeEnd\s*\*\//ig, "" ) + .replace( /\/\/\s*BuildExclude\n\r?[\w\W]*?\n\r?/ig, "" ); // Remove empty definitions contents = contents |