Closed
Description
Greetings!
Came across the problem of AgularJs minification. Some third party modules are not minified correctly with mangle option enabled. It throws error like Error: Unknown provider: tProvider <- t
. Unfortunately, there is no way to disable mangle via Encore interface. Please, add the option. Thank you in advance!
P.S. For those, experiencing the same problem, here's how I solved it:
...
let config = Encore.getWebpackConfig(),
webpack = require('webpack');
if (Encore.isProduction()) {
let index;
config.plugins.forEach((plugin, i) => {
if (plugin instanceof webpack.optimize.UglifyJsPlugin) {
index = i;
}
});
if (index) {
config.plugins.splice(index, 1);
}
config.plugins.push(new webpack.optimize.UglifyJsPlugin({
mangle: false,
sourceMap: !Encore.isProduction()
}));
}
Metadata
Metadata
Assignees
Labels
No labels