-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.build.ts
49 lines (48 loc) · 1.27 KB
/
webpack.config.build.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
48
49
import htmlWebpackPlugin from "html-webpack-plugin";
import path from "path";
import type webpack from "webpack";
import type { Configuration as WebpackDevServerConfiguration } from "webpack-dev-server";
export default (_env: any): webpack.Configuration & { devServer?: WebpackDevServerConfiguration } => ({
entry: "./src/index.ts",
output: {
path: path.join(__dirname, "/dist"),
filename: "[name].bundle.js",
clean: true
},
optimization: {
minimize: true
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: "ts-loader"
},
{
test: /\.html$/,
loader: "html-loader"
}
]
},
resolve: {
alias: {
// eslint-disable-next-line @typescript-eslint/naming-convention
"@": path.resolve(__dirname, "src")
},
modules: ["src", "node_modules"],
extensions: [".js", ".jsx", ".ts", ".tsx"],
fallback: {
"fs": false,
"path": false
}
},
plugins: [
new htmlWebpackPlugin({
template: "./src/index.html"
})
],
mode: "production",
experiments: {
asyncWebAssembly: true
}
});