grunt-terser

grunt-terser Giving SyntaxError: “VARIABLE_NAME” is redeclared

99封情书 提交于 2021-01-28 05:44:31
问题 I'm using grunt-terser to minify my es6 files. I have two files. file-1.js file-2.js In both files I have required a module with same variable name like this: const VARIABLE_NAME = require('MODULE_NAME'); Here is my grunt-terser task: terser: { main: { options: { compress: true, toplevel: true }, files: { './dist/app.js': ['file-1.js', 'file-2.js'] } } } When I run npx grunt terser I get the following error: Running "terser:main" (terser) task >> SyntaxError: "VARIABLE_NAME" is redeclared 来源: