This repository has been archived by the owner on May 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 74
/
Copy pathwebpack.config.js
87 lines (79 loc) · 1.78 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
const path = require('path');
const webpack = require('webpack');
module.exports = {
// generate source maps
devtool: 'source-map',
// bundling mode
mode: 'production',
target: 'web',
node: {
fs: 'empty',
net: 'empty',
tls: 'empty',
},
// entry files
entry: {
zilliqa: path.resolve(__dirname, 'packages/zilliqa/src/index.ts'),
},
// output bundles (location)
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].min.js',
library: 'Zilliqa',
libraryTarget: 'umd',
},
// file resolutions
resolve: {
extensions: ['.ts', '.js'],
alias: {
'@zilliqa-js/core': path.resolve(
__dirname,
'packages/zilliqa-js-core/src/index.ts',
),
'@zilliqa-js/account': path.resolve(
__dirname,
'packages/zilliqa-js-account/src/index.ts',
),
'@zilliqa-js/blockchain': path.resolve(
__dirname,
'packages/zilliqa-js-blockchain/src/index.ts',
),
'@zilliqa-js/contract': path.resolve(
__dirname,
'packages/zilliqa-js-contract/src/index.ts',
),
'@zilliqa-js/subscriptions': path.resolve(
__dirname,
'packages/zilliqa-js-subscriptions/src/index.ts',
),
'@zilliqa-js/crypto': path.resolve(
__dirname,
'packages/zilliqa-js-crypto/src/index.ts',
),
},
modules: ['node_modules'],
},
// loaders
module: {
rules: [
{
test: /\.ts?/,
use: {
loader: 'ts-loader',
options: {
transpileOnly: true,
},
},
exclude: /node_modules/,
},
],
},
// plugins
plugins: [
new webpack.SourceMapDevToolPlugin({
filename: '[file].map',
}),
],
// set watch mode to `true`
watch: false,
};