-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrspack.config.ts
59 lines (58 loc) · 1.46 KB
/
rspack.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
48
49
50
51
52
53
54
55
56
57
58
59
import { defineConfig } from "@rspack/cli";
import rspack from "@rspack/core";
export default defineConfig({
// context: __dirname,
optimization: {
minimizer: [],
splitChunks: {
chunks: "all",
},
moduleIds: "named",
chunkIds: "named",
},
output: {
chunkFilename: "./libs/[name].bundle.js",
chunkLoading: "import-scripts",
chunkFormat: "array-push",
clean: true,
},
mode: "development",
target: ["es2022"],
entry: {
service_worker: "./src/service_worker.ts",
},
resolve: {
extensions: [".ts", ".tsx", ".js", ".jsx", ".json"],
},
devtool: "source-map",
plugins: [
new rspack.CopyRspackPlugin({
patterns: [
{
from: "./extension",
to: "",
force: true,
},
],
}),
new rspack.ProgressPlugin({}),
].filter(Boolean),
module: {
rules: [
{
test: /\.ts$/,
exclude: [/node_modules/],
loader: "builtin:swc-loader",
options: {
jsc: {
target: "es2020",
parser: {
syntax: "typescript",
},
},
},
type: "javascript/auto",
},
],
},
});