Level 10
i had the same issue, ended 1-disabling the builtin uglifyJS
mix.options({
uglify: false,
});
then followed this post https://stackoverflow.com/questions/44287584/how-to-minify-es6-code-using-webpack
installed
"uglify-es": "^3.1.3",
"uglifyjs-webpack-plugin": "^1.0.0-beta.1",
then in webpack.mix.js
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
and added new UglifyJSPlugin() to
mix.webpackConfig ({
...
plugins: [
...
new UglifyJSPlugin()
]
});
this solution have an issue of minifying the assets in prod as in dev mode. but it works.
Hope it helps.