This repository has been archived by the owner on Jul 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.package.js
114 lines (103 loc) · 3.1 KB
/
webpack.package.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
const TerserPlugin = require("terser-webpack-plugin");
const path = require("path");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const packageConfig = {
mode: "production",
output: {
path: path.resolve(__dirname, "package", "dist"),
filename: "[name].js",
library: {
name: "VenomWalletController",
type: "umd"
},
clean: true
},
target: "web",
resolve: {
extensions: [ ".tsx", ".jsx", ".js", ".ts" ]
},
stats: "minimal",
entry: {
"VenomWalletController": path.resolve(__dirname, "package", "VenomWalletController"),
"utils/waiting-venom-promise": path.resolve(__dirname, "package", "utils", "waiting-venom-promise"),
"utils/init-venom-connect": path.resolve(__dirname, "package", "utils", "init-venom-connect")
},
plugins: [],
module: {
rules: [
{
test: /\.jsx?$/i,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
},
{
test: /\.tsx?$/i,
exclude: /node_modules/,
use: {
loader: "ts-loader",
options: {
configFile: "tsconfig.json"
}
}
},
{
test: /\.s[ac]ss$/i,
use: [ MiniCssExtractPlugin.loader, "css-loader", "postcss-loader", "sass-loader" ]
}
]
},
externals: {
"mobx": {
commonjs: "mobx",
commonjs2: "mobx",
amd: "mobx"
},
"@knownout/base-controller": {
commonjs: "@knownout/base-controller",
commonjs2: "@knownout/base-controller",
amd: "@knownout/base-controller"
},
"everscale-inpage-provider": {
commonjs: "everscale-inpage-provider",
commonjs2: "everscale-inpage-provider",
amd: "everscale-inpage-provider"
},
"everscale-standalone-client": {
commonjs: "everscale-standalone-client",
commonjs2: "everscale-standalone-client",
amd: "everscale-standalone-client"
},
"venom-connect": {
commonjs: "venom-connect",
commonjs2: "venom-connect",
amd: "venom-connect"
},
"react-is": {
commonjs: "react-is",
commonjs2: "react-is",
amd: "react-is"
},
"bignumber.js": {
commonjs: "bignumber.js",
commonjs2: "bignumber.js",
amd: "bignumber.js"
}
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
extractComments: false,
terserOptions: {
format: {
comments: false
}
}
})
]
}
};
packageConfig.module.rules[1].use.options.configFile = "tsconfig.package.json";
module.exports = packageConfig;