From: Alexander Ebert Date: Thu, 20 Aug 2020 16:13:45 +0000 (+0200) Subject: uglifyjs.minify expects the code and not a path X-Git-Tag: 5.3.0_Alpha_1~43 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c33f92754dc7e394f0293af6f49946c96bb0aa14;p=GitHub%2FWoltLab%2FWCF.git 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 --- 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 +}