Skip to content Skip to sidebar Skip to footer

Webpack 2: Error In ./public/bundle.js From Uglifyjs Unexpected Character '`'

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. Second: when I run webpack -d I only get a minified bu

Solution 1:

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",

Post a Comment for "Webpack 2: Error In ./public/bundle.js From Uglifyjs Unexpected Character '`'"