Skip to content

Commit 464c2b5

Browse files
Thomas Hunzikerrdeutz
authored andcommitted
[4.0] Fix npm script on windows (#21505)
* Fix compile-es6 script on Windows machines. * Adding back .min.js
1 parent feb5abc commit 464c2b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

build/build-modules-js/compile-es6.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const compileFile = (filePath) => {
2727
const fileName = filePath.slice(0, -7);
2828
console.log(`Compiling: ${fileName.replace('/build/media_src/', '/media/')}.js`);
2929
fs.writeFile(
30-
`${fileName.replace('/build/media_src/', '/media/')}.js`,
30+
`${fileName.replace('/build/media_src/', '/media/').replace('\\build\\media_src\\', '\\media\\')}.js`,
3131
result.code + os.EOL,
3232
(fsError) => {
3333
if (fsError) {
@@ -39,7 +39,7 @@ const compileFile = (filePath) => {
3939
);
4040
// Also write the minified
4141
fs.writeFile(
42-
`${fileName.replace('/build/media_src/', '/media/')}.min.js`,
42+
`${fileName.replace('/build/media_src/', '/media/').replace('\\build\\media_src\\', '\\media\\')}.min.js`,
4343
UglifyJS.minify(result.code).code + os.EOL,
4444
(fsError) => {
4545
if (fsError) {

0 commit comments

Comments
 (0)