Closed disbelief closed 6 years ago
Got it working. This is what I did:
npm i -D uglifyjs-webpack-plugin
webpack.config.js:
const ExtractTextPlugin = require('extract-text-webpack-plugin')
+
+ const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
// ...
plugins: [
new ExtractTextPlugin('app.[contenthash:20].css'),
new webpack.optimize.OccurrenceOrderPlugin(),
- new webpack.optimize.UglifyJsPlugin({
- compressor: {
- warnings: false
+ new UglifyJsPlugin({
+ parallel: 2,
+ uglifyOptions: {
+ ecma: 8
}
}),
Hi there, loving the boilerplate! It's been super helpful getting a new project up and running.
I'm having some difficulty getting the project to build successfully for production. When I run
npm run build
everything seems to compile fine, but UglifyJs dies with this error:Taking a look at that line position in the generated source, I see an arrow function:
I have tried upgrading to the latest webpack
3.10.0
, and I've been playing around with theuglifyOptions
passed into thewebpack.optimize.UglifyJsPlugin
but so far no luck. These are my current options:Any idea what I can do to fix this?