aboutsummaryrefslogtreecommitdiffstats
path: root/build/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'build/tasks')
-rw-r--r--build/tasks/build.js8
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]+$/, "" );