I have been trying to strip comments in the webpack bundled js file. I have tried several methods but it's not working still and I get comments like
"/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\ ...
For this the bundled file is getting huge. Currently huge at 1.6mb size. I have tried this
new webpack.optimize.UglifyJsPlugin({
sourceMap: false,
compress: {
sequences: true,
dead_code: true,
conditionals: true,
booleans: true,
unused: true,
if_return: true,
join_vars: true,
drop_console: true
},
mangle: {
except: ['$super', '$', 'exports', 'require']
},
output: {
comments: false
}
})
also this
new webpack.optimize.UglifyJsPlugin({
compress: { warnings: false },
sourceMap: false,
output: false
})
Also set the enviroment to production
set NODE_ENV=production
I am not able to understand where I am wrong. Please help. Thanks in advance.