Fix gulp build on Windows (#3894)

* Fix gulp build compressed on Windows

Need to escape the separate for the regex.

* nit: formatt
This commit is contained in:
Sam El-Husseini
2020-05-08 10:05:07 -07:00
committed by GitHub
parent 60a8eb63fe
commit cb86ad766e

View File

@@ -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;
}))