mirror of
https://github.com/jquery/jquery.git
synced 2026-02-01 15:34:56 -05:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user