webpack 2: ERROR in ./public/bundle.js from UglifyJs Unexpected character '`'

后端 未结 1 840
小蘑菇
小蘑菇 2021-01-05 01:29

I got 2 related issues:

First: when I run npm run build the bundle.js file is not minified but I do get a bundle.js.map file.<

相关标签:
1条回答
  • 2021-01-05 01:52

    UglifyJS2 does not have ES6/Harmony support in its releases yet. However, there's the Harmony branch which allows you to minify/uglify files with ES6 syntax.

    I can suggest you an alternative solution which could help you spend less build time to transpile all ES6 to ES5.

    Simply specify UglifyJs in your package.json, and let npm handles the dependencies. "uglify-js": "git://github.com/mishoo/UglifyJS2#harmony-v2.8.22",

    0 讨论(0)
提交回复
热议问题