-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.common.js
More file actions
83 lines (81 loc) · 3.01 KB
/
Copy pathwebpack.common.js
File metadata and controls
83 lines (81 loc) · 3.01 KB
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
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: {
device: './assets/javascript/device.ts',
redeem: './assets/javascript/redeem.ts',
update: './assets/javascript/update.ts',
release_notes: './assets/javascript/release_notes.ts',
version_history: './assets/javascript/version_history.ts',
air_gapped: './assets/javascript/air_gapped.ts',
base: './assets/javascript/base.ts',
},
module: {
rules: [
{
test: /\.tsx?$/,
use: [
{
loader: 'ts-loader',
options: {
transpileOnly: true
}
}
],
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
fallback: {
"fs": false,
"buffer": require.resolve("buffer")
},
alias: {
ethers: 'ethers/lib',
'@ethersproject/abi': '@ethersproject/abi/lib',
'@ethersproject/abstract-provider': '@ethersproject/abstract-provider/lib',
'@ethersproject/abstract-signer': '@ethersproject/abstract-signer/lib',
'@ethersproject/address': '@ethersproject/address/lib',
'@ethersproject/base64': '@ethersproject/base64/lib',
'@ethersproject/basex': '@ethersproject/basex/lib',
'@ethersproject/bignumber': '@ethersproject/bignumber/lib',
'@ethersproject/bytes': '@ethersproject/bytes/lib',
'@ethersproject/constants': '@ethersproject/constants/lib',
'@ethersproject/contracts': '@ethersproject/contracts/lib',
'@ethersproject/hash': '@ethersproject/hash/lib',
'@ethersproject/hdnode': '@ethersproject/hdnode/lib',
'@ethersproject/json-wallets': '@ethersproject/json-wallets/lib',
'@ethersproject/keccak256': '@ethersproject/keccak256/lib',
'@ethersproject/logger': '@ethersproject/logger/lib',
'@ethersproject/networks': '@ethersproject/networks/lib',
'@ethersproject/pbkdf2': '@ethersproject/pbkdf2/lib',
'@ethersproject/properties': '@ethersproject/properties/lib',
'@ethersproject/providers': '@ethersproject/providers/lib',
'@ethersproject/random': '@ethersproject/random/lib',
'@ethersproject/rlp': '@ethersproject/rlp/lib',
'@ethersproject/sha2': '@ethersproject/sha2/lib',
'@ethersproject/signing-key': '@ethersproject/signing-key/lib',
'@ethersproject/solidity': '@ethersproject/solidity/lib',
'@ethersproject/strings': '@ethersproject/strings/lib',
'@ethersproject/transactions': '@ethersproject/transactions/lib',
'@ethersproject/units': '@ethersproject/units/lib',
'@ethersproject/wallet': '@ethersproject/wallet/lib',
'@ethersproject/web': '@ethersproject/web/lib',
'@ethersproject/wordlists': '@ethersproject/wordlists/lib'
},
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, './static/keycard_shell/js'),
},
plugins: [
new webpack.ProvidePlugin({
process: 'process/browser',
}),
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
})
]
};