2018-07-11 14:47:29 -07:00
|
|
|
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
|
2019-03-20 11:35:26 -07:00
|
|
|
const webpack = require('webpack'); //to access built-in plugins
|
|
|
|
|
2018-04-26 12:53:42 +10:00
|
|
|
module.exports = {
|
2018-08-16 10:49:01 +10:00
|
|
|
entry: {
|
|
|
|
'dweb-transports': './index.js',
|
|
|
|
},
|
|
|
|
output: {
|
|
|
|
filename: '[name]-bundle.js',
|
|
|
|
path: __dirname + '/dist'
|
|
|
|
},
|
2018-04-26 12:53:42 +10:00
|
|
|
node: {
|
|
|
|
fs: 'empty',
|
|
|
|
net: 'empty',
|
|
|
|
tls: 'empty',
|
|
|
|
crypto: 'empty',
|
|
|
|
process: true,
|
|
|
|
module: false,
|
|
|
|
clearImmediate: false,
|
|
|
|
Buffer: true,
|
|
|
|
setImmediate: false,
|
2019-06-19 14:54:12 +10:00
|
|
|
console: false,
|
|
|
|
dgram: 'empty'
|
2018-04-26 12:53:42 +10:00
|
|
|
},
|
|
|
|
|
2019-03-20 11:35:26 -07:00
|
|
|
plugins: [
|
|
|
|
new webpack.EnvironmentPlugin({
|
|
|
|
WOLK_ENV: 'idb',
|
|
|
|
})
|
|
|
|
],
|
|
|
|
|
2018-04-26 12:53:42 +10:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
2019-03-20 11:35:26 -07:00
|
|
|
zlib: 'browserify-zlib-next',
|
|
|
|
zlib: 'zlib'
|
2018-04-26 12:53:42 +10:00
|
|
|
}
|
2018-07-11 14:47:29 -07:00
|
|
|
},
|
2018-08-16 10:49:01 +10:00
|
|
|
optimization: {
|
|
|
|
minimizer: [
|
|
|
|
new UglifyJsPlugin({
|
|
|
|
uglifyOptions: {
|
|
|
|
compress: {
|
|
|
|
unused: false,
|
|
|
|
collapse_vars: false // debug has a problem in production without this.
|
|
|
|
}
|
|
|
|
|
|
|
|
//compress: false
|
2018-07-11 14:47:29 -07:00
|
|
|
}
|
2018-08-16 10:49:01 +10:00
|
|
|
})
|
|
|
|
]
|
|
|
|
}
|
2019-03-20 11:35:26 -07:00
|
|
|
}
|