-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.production.config.js
67 lines (60 loc) · 2.06 KB
/
webpack.production.config.js
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
const path = require('path');
const common = {
entry: './src/index.ts',
mode: 'production',
optimization: {
minimize: false
},
resolve: {
extensions: ['.ts', '.js']
},
module: {
rules: [
{
test: /\.node$/,
use: 'node-loader'
},
{
test: /\.(j|t)sx?$/,
include: [
path.resolve(__dirname, './src'),
path.resolve(__dirname, './config.js'),
path.join(__dirname, 'node_modules', 'bitcoinjs-lib'),
path.join(__dirname, 'node_modules', 'tiny-secp256k1'),
path.join(__dirname, 'node_modules', 'bip32'),
path.join(__dirname, 'node_modules', 'typeforce'),
path.join(__dirname, 'node_modules', 'eosjs-ecc'),
path.join(__dirname, 'node_modules', 'eosjs'),
path.join(__dirname, 'node_modules', 'base-x'),
path.join(__dirname, 'node_modules', 'ethereumjs-wallet'),
path.join(__dirname, 'node_modules', 'ethereumjs-tx'),
path.join(__dirname, 'node_modules', 'ethereumjs-util'),
path.join(__dirname, 'node_modules', 'rlp')
],
loader: 'babel-loader'
}
]
}
};
const serverConfig = {
target: 'node',
output: {
library: 'MultiBlockchainWallet',
libraryTarget: 'commonjs',
path: path.resolve(__dirname, 'dist'),
filename: 'index.node.js',
globalObject: 'typeof self !== \'undefined\' ? self : this' // TODO - remove when its fixed, https://github.com/webpack/webpack/issues/6784
},
...common
};
const clientConfig = {
target: 'web', // <=== can be omitted as default is 'web'
output: {
library: 'MultiBlockchainWallet',
libraryTarget: 'umd',
path: path.resolve(__dirname, 'dist'),
filename: 'index.js'
},
...common
};
module.exports = [clientConfig];