-
Notifications
You must be signed in to change notification settings - Fork 19
/
webpack.config.js
47 lines (46 loc) · 1.13 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
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const { IgnorePlugin } = require('webpack')
const config = {
devtool: "cheap-source-map",
entry: ['./src/index.ts'],
output: {
path: __dirname + '/lib',
filename: 'cosmos-keys.js',
library: 'cosmos-keys',
libraryTarget: 'umd',
umdNamedDefine: true,
globalObject: 'typeof self !== \'undefined\' ? self : this',
},
resolve: {
extensions: ['.tsx', '.ts', '.js']
},
module: {
rules: [
{
loader: 'babel-loader',
test: /\.js$/,
exclude: /node_modules/,
query: {
presets: ['@babel/preset-env']
}
},
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/
}
]
},
plugins: [
new BundleAnalyzerPlugin({
analyzerMode: 'static',
openAnalyzer: false,
reportFilename: '../bundle_analyzer/bundle_sizes.html'
}),
new IgnorePlugin({
checkContext: context => context.includes('bip39/src/wordlists'),
checkResource: resource => resource !== './english.json'
})
]
}
module.exports = config