-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathwebpack.config.js
127 lines (126 loc) · 3.79 KB
/
webpack.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const CleanWebpackPlugin = require('clean-webpack-plugin')
const buildPath = path.resolve(__dirname, 'dist')
module.exports = {
entry: {
app: ['babel-polyfill', './src/index.js'],
ethsigning: ['babel-polyfill', './src/eth-signing.js'],
depositwithdraweth: ['babel-polyfill', './src/deposit-withdraw-eth.js'],
depositwithdrawerc20: ['babel-polyfill', './src/deposit-withdraw-erc20.js'],
depositwithdrawerc721: ['babel-polyfill', './src/deposit-withdraw-erc-721.js'],
depositwithdrawtron: ['babel-polyfill', './src/deposit-withdraw-tron.js'],
ethsigningportis: ['babel-polyfill', './src/eth-signing-portis.js'],
ethsigningfortmatic: ['babel-polyfill', './src/eth-signing-fortmatic.js'],
bnbdepositwithdraw: ['babel-polyfill', './src/bnb-deposit-withdraw.js'],
bep2depositwithdraw: ['babel-polyfill', './src/bep2-deposit-withdraw.js'],
binanceloomethereum: ['babel-polyfill', './src/binance-loom-ethereum.js'],
payabledemo: ['babel-polyfill', './src/payable-demo.js']
},
output: {
filename: '[name].[hash:20].js',
path: buildPath
},
plugins: [
new HtmlWebpackPlugin({
template: './src/index.html',
inject: true,
chunks: ['index'],
filename: 'index.html'
}),
new HtmlWebpackPlugin({
template: './src/eth-signing.html',
inject: true,
chunks: ['ethsigning'],
filename: 'eth-signing.html'
}),
new HtmlWebpackPlugin({
template: './src/deposit-withdraw-eth.html',
inject: true,
chunks: ['depositwithdraweth'],
filename: 'deposit-withdraw-eth.html'
}),
new HtmlWebpackPlugin({
template: './src/deposit-withdraw-erc20.html',
inject: true,
chunks: ['depositwithdrawerc20'],
filename: 'deposit-withdraw-erc20.html'
}),
new HtmlWebpackPlugin({
template: './src/deposit-withdraw-erc-721.html',
inject: true,
chunks: ['depositwithdrawerc721'],
filename: 'deposit-withdraw-erc-721.html'
}),
new HtmlWebpackPlugin({
template: './src/deposit-withdraw-tron.html',
inject: true,
chunks: ['depositwithdrawtron'],
filename: 'deposit-withdraw-tron.html'
}),
new HtmlWebpackPlugin({
template: './src/eth-signing-portis.html',
inject: true,
chunks: ['ethsigningportis'],
filename: 'eth-signing-portis.html'
}),
new HtmlWebpackPlugin({
template: './src/eth-signing-fortmatic.html',
inject: true,
chunks: ['ethsigningfortmatic'],
filename: 'eth-signing-fortmatic.html'
}),
new HtmlWebpackPlugin({
template: './src/bnb-deposit-withdraw.html',
inject: true,
chunks: ['bnbdepositwithdraw'],
filename: 'bnb-deposit-withdraw.html'
}),
new HtmlWebpackPlugin({
template: './src/bep2-deposit-withdraw.html',
inject: true,
chunks: ['bep2depositwithdraw'],
filename: 'bep2-deposit-withdraw.html'
}),
new HtmlWebpackPlugin({
template: './src/binance-loom-ethereum.html',
inject: true,
chunks: ['binanceloomethereum'],
filename: 'binance-loom-ethereum.html'
}),
new HtmlWebpackPlugin({
template: './src/payable-demo.html',
inject: true,
chunks: ['payabledemo'],
filename: 'payable-demo.html'
}),
new CleanWebpackPlugin()
],
module: {
rules: [
{
test: [/.js$/],
exclude: /(node_modules)/,
use: {
loader: 'babel-loader',
options: {
presets: [
'@babel/preset-env'
]
}
}
},
{
test: [/.css$/],
use: [
'style-loader',
'css-loader'
]
}
]
},
node: {
fs: 'empty',
child_process: 'empty'
}
}