From c33f92754dc7e394f0293af6f49946c96bb0aa14 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 20 Aug 2020 18:13:45 +0200 Subject: [PATCH] uglifyjs.minify expects the code and not a path For whatever reason that this has worked in the past, in node 14+ the behavior appears to have been changed. The `cascade` option is not mentioned in the list of valid options and since error message were implicitly suppressed, this went by unnoticed. Fixes #3520 --- extra/_buildCore.js | 2 +- extra/compiler.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/extra/_buildCore.js b/extra/_buildCore.js index 2338f1837b..ffb511ce78 100644 --- a/extra/_buildCore.js +++ b/extra/_buildCore.js @@ -118,7 +118,7 @@ fs.readdirSync("./") .forEach(filename => { console.time(filename); { - let output = compiler.compile(process.cwd() + `/${filename}`); + let output = compiler.compile(fs.readFileSync(process.cwd() + `/${filename}`, 'utf-8')); fs.writeFileSync(filename.replace(/\.js$/, '.min.js'), output.code); } console.timeEnd(filename); diff --git a/extra/compiler.js b/extra/compiler.js index b700ebc9cf..f5f18eb6ce 100644 --- a/extra/compiler.js +++ b/extra/compiler.js @@ -14,7 +14,6 @@ const uglifyJsConfig = { hoist_vars: true, if_return: true, join_vars: true, - cascade: true, /* this is basically the `--define` argument */ global_defs: { COMPILER_TARGET_DEFAULT: false @@ -30,4 +29,4 @@ module.exports = { filename, Object.assign(uglifyJsConfig, overrides)); } -} \ No newline at end of file +} -- 2.20.1