I currently have this
ready : function(){
bus.$on('a-data', (param) => {
this.name = param.name;
this.age = param.age;
})
},
While this particular code run when uglifyjs
is disabled, when enabled it throws the following error
SyntaxError: Unexpected token: operator (>)
Here's my uglify config
new webpack.optimize.UglifyJsPlugin({
minimize: true,
sourceMap: false,
compress: {
warnings: false,
sequences: true,
dead_code: true,
conditionals: true,
booleans: true,
unused: true,
if_return: true,
join_vars: true,
drop_console: true
}
}))
I can't seem to understand why it's not working. Any ideas?
UglifyJS does not have ES6/Harmony support built in yet.
They have an open GitHub issue for tracking the status of that feature.
This is usually not an issue because most people tend to run their ES6 code through Babel first for back compatibility with old browsers, and the result of that would pass through Uglify.