-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.ts
46 lines (44 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
import path from "path";
import webpack from "webpack";
import HtmlWebpackPlugin from "html-webpack-plugin";
const webpackConfig: webpack.Configuration = {
mode: "production",
entry: "./src/index.tsx",
output: {
filename: "app.bundle.[contenthash].js",
path: path.resolve(__dirname, "build"),
},
module: {
rules: [
{
test: /\.(ts|tsx)$/,
use: "ts-loader",
exclude: /node_modules/,
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"],
},
],
},
resolve: {
extensions: [".tsx", ".ts", ".js", ".css"],
alias: {
react: "preact/compat",
"react-dom/test-utils": "preact/test-utils",
"react-dom": "preact/compat",
"react/jsx-runtime": "preact/jsx-runtime",
},
},
devtool: "inline-source-map",
plugins: [
new HtmlWebpackPlugin({
template: "src/template.html",
}),
],
performance: {
maxEntrypointSize: 2000000,
maxAssetSize: 2000000,
},
};
export default webpackConfig;