Fix debug in production webpack (same change made on dweb-transports dweb-objects and dweb-archive)

This commit is contained in:
Mitra Ardron 2018-08-16 10:49:01 +10:00
parent 2ec151a008
commit d84e5468d8
2 changed files with 22 additions and 17 deletions

View File

@ -49,5 +49,5 @@
"test": "cd src; node ./test.js", "test": "cd src; node ./test.js",
"help": "echo 'test (test it)'; echo 'build (creates dweb-transports-bundle)'" "help": "echo 'test (test it)'; echo 'build (creates dweb-transports-bundle)'"
}, },
"version": "0.1.12" "version": "0.1.13"
} }

View File

@ -1,12 +1,12 @@
const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
module.exports = { module.exports = {
entry: { entry: {
'dweb-transports': './index.js', 'dweb-transports': './index.js',
}, },
output: { output: {
filename: '[name]-bundle.js', filename: '[name]-bundle.js',
path: __dirname + '/dist' path: __dirname + '/dist'
}, },
node: { node: {
fs: 'empty', fs: 'empty',
net: 'empty', net: 'empty',
@ -25,13 +25,18 @@ module.exports = {
zlib: 'browserify-zlib-next' zlib: 'browserify-zlib-next'
} }
}, },
plugins: [ optimization: {
new UglifyJsPlugin({ minimizer: [
uglifyOptions: { new UglifyJsPlugin({
compress: { uglifyOptions: {
unused: false compress: {
unused: false,
collapse_vars: false // debug has a problem in production without this.
}
//compress: false
} }
} })
}) ]
] }
} }