forked from gyrostable/alpha-testnet
-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.ts
47 lines (45 loc) · 1.01 KB
/
webpack.config.ts
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
import * as path from "path";
import * as webpack from "webpack";
import CopyPlugin from "copy-webpack-plugin";
const config: webpack.Configuration = {
mode: "production",
entry: "./index.ts",
devtool: "source-map",
module: {
rules: [
{
test: /(?<!\.d)\.tsx?$/,
use: [{ loader: "ts-loader", options: { configFile: "tsconfig.webpack.json" } }],
exclude: /node_modules/,
},
{
test: /\.d\.ts$/,
loader: "ignore-loader",
},
],
},
resolve: {
extensions: [".tsx", ".ts", ".js", ".d.ts"],
},
output: {
path: path.resolve(__dirname, "dist"),
filename: "gyro-core.bundle.js",
libraryTarget: "commonjs",
globalObject: "this",
},
externals: {
ethers: "ethers",
"@ethersproject/contracts": "@ethersproject/contracts",
},
plugins: [
new CopyPlugin({
patterns: [
{
from: "typechain/*.d.ts",
to: "typechain/[name].[ext]",
},
],
}),
],
};
export default config;