diff options
author | Timmy Willison <timmywillisn@gmail.com> | 2013-09-09 09:50:12 -0400 |
---|---|---|
committer | Timmy Willison <timmywillisn@gmail.com> | 2013-09-09 11:47:03 -0400 |
commit | ee0343dd1bf3d8b39a6cd10deb5b3ca59178bb65 (patch) | |
tree | 79610868ca39ece33d3f983cc22ac0810b43f3b2 /build | |
parent | a289beb688388fb75d16b0a7eed9d29d747f4c5b (diff) | |
download | jquery-ee0343dd1bf3d8b39a6cd10deb5b3ca59178bb65.tar.gz jquery-ee0343dd1bf3d8b39a6cd10deb5b3ca59178bb65.zip |
Add AMD+CommonJS capabilities to the build script (for modules with long unreadable dependency lists)
Conflicts:
src/core.js
Diffstat (limited to 'build')
-rw-r--r-- | build/tasks/build.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/build/tasks/build.js b/build/tasks/build.js index 79c7860e1..93c47c0ff 100644 --- a/build/tasks/build.js +++ b/build/tasks/build.js @@ -62,6 +62,14 @@ module.exports = function( grunt ) { .replace( /define\([^{]*?{/, "" ) .replace( rdefineEnd, "" ); + // Remove CommonJS-style require calls + // Keep an ending semicolon + contents = contents + .replace( /\w+ = require\(\s*(")[\w\.\/]+\1\s*\)([,;])/g, + function( all, quote, commaSemicolon ) { + return commaSemicolon === ";" ? ";" : ""; + }); + // Remove empty definitions contents = contents .replace( /define\(\[[^\]]+\]\)[\W\n]+$/, "" ); |