mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Don't keep semicolons if the require call is not a var declaration
This commit is contained in:
parent
99191a510e
commit
d788010aa7
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user