From 034ae878c625e347ceca6fcc76363f40ce00637e Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Mon, 16 Dec 2019 14:05:31 -0800 Subject: [PATCH] Fix gulp blocks compile build (#3519) * Fix gulp build by adding Comment, Mutator and Warning to the remove regex. --- gulpfile.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gulpfile.js b/gulpfile.js index 18abff83b..c74b334ce 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -197,6 +197,9 @@ gulp.task('build-core', function () { * blocks_compressed.js */ gulp.task('build-blocks', function () { + // Add provides used throughout blocks/ in order to be compatible with the + // compiler. Anything added to this list must be removed from the compiled + // result using the remove regex steps below. const provides = ` goog.provide('Blockly'); goog.provide('Blockly.Blocks'); @@ -227,6 +230,8 @@ goog.provide('Blockly.Warning');`; .pipe(gulp.replace(/var Blockly=\{[^;]*\};\n?/, '')) // Remove Blockly Fields to be compatible with Blockly. .pipe(gulp.replace(/Blockly\.Field[^=\(]+=\{[^;]*\};/g, '')) + // Remove Blockly Warning, Comment & Mutator to be compatible with Blockly. + .pipe(gulp.replace(/Blockly\.(Comment|Warning|Mutator)=\{[^;]*\};/g, '')) .pipe(prependHeader()) .pipe(gulp.dest('./')); });