Closed RahavLussato closed 7 years ago
Hello @RahavLussato! Thanks for reporting this issue.
I will take a look on this issue, but for now you can use new webpack.optimize.UglifyJsPlugin(...)
.
Sorry for inconvenience.
@RahavLussato I have read whole conversation, tried some workarounds and I can tell that root issue in uglifyjs-webpack-plugin@1.0.0-beta.2
.
Need to merge all configs into single one to exclude webpack-config
related issues:
const path = require('path'),
webpack = require('webpack'),
UglifyJSPlugin = require('uglifyjs-webpack-plugin');
module.exports = {
output: {
path: path.join(__dirname, './dist/bundledCode'),
filename: "bundle.js?[hash]" ,
publicPath: '/'
},
node: {
fs: 'empty'
},
externals: [
{
'./cptable': 'var cptable'
},
{
'./jszip': 'jszip'
}
],
devtool: 'source-map',
entry: {
js: ['./src/client.jsx']
},
plugins: [
new webpack.IgnorePlugin(/jsdom$/),
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: Infinity,
filename: '[name].js?[hash]'
}),
new UglifyJSPlugin({
uglifyOptions: {
mangle: { properties: {reserved: ['$super', '$', 'exports', 'require'] }},
ecma: 8,
compress: { warnings: false },
output: {
comments: false,
beautify: false
}
},
parallel: {
cache: true
},
sourceMap: true
})
],
resolve: {
descriptionFiles: ["package.json"],
extensions: ['.json', '.js', '.jsx'],
modules: [path.resolve(__dirname, "../"), "node_modules"]
},
module: {
loaders: [
{ test: /\.(js|jsx)$/, exclude: /node_modules/, use:"babel-loader?compact=false" }
]
}
};
If we run yarn build
with uglifyjs-webpack-plugin@1.0.0-beta.2
we will get unminified version, but if we switch back to uglifyjs-webpack-plugin@0.4.6
(or webpack.optimize.UglifyJsPlugin
) the everything will work fine.
@RahavLussato Do you mind if I close this issue?
@mdreizin thanks for the help
you can check that here