From cb86ad766ebd7568a6207512c5663bdd29669583 Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Fri, 8 May 2020 10:05:07 -0700 Subject: [PATCH] Fix gulp build on Windows (#3894) * Fix gulp build compressed on Windows Need to escape the separate for the regex. * nit: formatt --- scripts/gulpfiles/build_tasks.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/gulpfiles/build_tasks.js b/scripts/gulpfiles/build_tasks.js index cd66d8504..11fdcb2fc 100644 --- a/scripts/gulpfiles/build_tasks.js +++ b/scripts/gulpfiles/build_tasks.js @@ -191,7 +191,8 @@ function buildCompressed() { // Flatten all files so they're in the same directory, but ensure that // files with the same name don't conflict. .pipe(gulp.rename(function (p) { - var dirname = p.dirname.replace(new RegExp(path.sep, "g"), "-"); + var dirname = p.dirname.replace( + new RegExp(path.sep.replace(/\\/, '\\\\'), "g"), "-"); p.dirname = ""; p.basename = dirname + "-" + p.basename; }))