forked from CoboVault/crypto-coin-kit
-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.config.js
60 lines (58 loc) · 1.42 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
/**
* @file webpack build for j2v8 call this lib, Multi entry for each coin and utils
*/
const path = require('path');
const TerserPlugin = require('terser-webpack-plugin');
const WebpackGitHash = require('webpack-git-hash');
module.exports = {
entry: {
BTC: './src/BTC/index.ts',
ETH: './src/ETH/index.ts',
XRP: './src/XRP/index.ts',
BCH: './src/BCH/index.ts',
DASH: './src/DASH/index.ts',
LTC: './src/LTC/index.ts',
TRON: './src/TRON/index.ts',
utils: './src/utils/index.ts',
},
mode: 'production',
module: {
rules: [
{
test: /\.ts$/,
use: ['ts-loader'],
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
output: {
filename: '[name].bundle_[githash].js',
libraryTarget: 'umd',
// library: ['cryptoCoinKit', '[name]'],
path: path.resolve(__dirname, 'packed/subBundle'),
},
plugins: [
new WebpackGitHash()
],
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
extractComments: true,
cache: true,
parallel: true,
sourceMap: false, // Must be set to true if using source-maps in production
terserOptions: {
// https://github.com/webpack-contrib/terser-webpack-plugin#terseroptions
extractComments: 'all',
compress: {
drop_console: true,
},
},
}),
],
},
};