-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathrspack.config.js
37 lines (35 loc) · 917 Bytes
/
rspack.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
const path = require("node:path")
module.exports = (env, argv) => {
const {
base,
devServer,
assetRule,
sassRule,
postcssRule,
swcWithReactRule,
cssExtractPlugin,
htmlSingleChunkPlugin,
truthy,
} = require("./rspack.library.js")(argv.mode === "production")
return {
...base,
context: path.resolve(process.cwd()),
entry: {
main: "./workbench/static/workbench/main.js",
timer: "./timer/index.js",
absences: "./absences/index.js",
planning: "./planning/index.js",
},
devServer: devServer({ backendPort: env.backend }),
module: {
rules: [assetRule(), postcssRule(), sassRule(), swcWithReactRule()],
},
plugins: truthy(
cssExtractPlugin(),
htmlSingleChunkPlugin("main"),
htmlSingleChunkPlugin("timer"),
htmlSingleChunkPlugin("absences"),
htmlSingleChunkPlugin("planning"),
),
}
}