-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
46 lines (44 loc) · 1 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
import HtmlWebpackPlugin from "html-webpack-plugin";
import ResolveTypeScriptPlugin from "resolve-typescript-plugin";
import path from "path";
import { fileURLToPath } from "url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
export default {
experiments: {
topLevelAwait: true,
},
devServer: {
static: {
directory: path.resolve(__dirname),
publicPath: "/",
},
allowedHosts: "all",
hot: true,
},
entry: "./src/index.tsx",
mode: "development",
resolve: {
plugins: [new ResolveTypeScriptPlugin()],
extensions: [".dev.js", ".js", ".json", ".wasm", "ts", "tsx"],
fallback: {
crypto: false,
path: false,
fs: false,
},
},
plugins: [new HtmlWebpackPlugin({ template: "./src/index.html" })],
module: {
rules: [
{
test: /\.sql$/i,
use: "raw-loader",
},
{
test: /\.tsx?$/,
use: "ts-loader",
exclude: /node_modules/,
},
],
},
};