forked from bcoin-org/bcoin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.browser.js
More file actions
36 lines (34 loc) · 821 Bytes
/
webpack.browser.js
File metadata and controls
36 lines (34 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
'use strict';
const webpack = require('webpack');
const path = require('path');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const str = JSON.stringify;
const env = process.env;
module.exports = {
target: 'web',
entry: {
'bcoin': './lib/bcoin-browser',
'bcoin-worker': './lib/workers/worker'
},
output: {
path: path.join(__dirname, 'browser'),
filename: '[name].js'
},
resolve: {
modules: ['node_modules'],
extensions: ['-browser.js', '.js', '.json']
},
plugins: [
new webpack.DefinePlugin({
'process.env.BCOIN_NETWORK':
str(env.BCOIN_NETWORK || 'main'),
'process.env.BCOIN_WORKER_FILE':
str(env.BCOIN_WORKER_FILE || '/bcoin-worker.js')
}),
new UglifyJsPlugin({
compress: {
warnings: true
}
})
]
};