UNPKG

1.24 kBJavaScriptView Raw
1const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
2const webpack = require('webpack'); //to access built-in plugins
3
4module.exports = {
5 entry: {
6 'dweb-transports': './index.js',
7 },
8 output: {
9 filename: '[name]-bundle.js',
10 path: __dirname + '/dist'
11 },
12 node: {
13 fs: 'empty',
14 net: 'empty',
15 tls: 'empty',
16 crypto: 'empty',
17 process: true,
18 module: false,
19 clearImmediate: false,
20 Buffer: true,
21 setImmediate: false,
22 console: false,
23 dgram: 'empty'
24 },
25
26 plugins: [
27 new webpack.EnvironmentPlugin({
28 WOLK_ENV: 'idb',
29 })
30 ],
31
32 resolve: {
33 alias: {
34 zlib: 'browserify-zlib-next',
35 zlib: 'zlib'
36 }
37 },
38 optimization: {
39 minimizer: [
40 new UglifyJsPlugin({
41 sourceMap: true,
42 uglifyOptions: {
43 compress: {
44 unused: false,
45 collapse_vars: false // debug has a problem in production without this.
46 }
47
48 //compress: false
49 }
50 })
51 ]
52 },
53 devtool: 'source-map'
54}