-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrsbuild.config.ts
More file actions
59 lines (58 loc) · 1.4 KB
/
Copy pathrsbuild.config.ts
File metadata and controls
59 lines (58 loc) · 1.4 KB
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 "@rsbuild/core";
import { pluginBabel } from "@rsbuild/plugin-babel";
import { pluginSolid } from "@rsbuild/plugin-solid";
import { BannerPlugin } from "@rspack/core";
import CompressionPlugin from "compression-webpack-plugin";
export default defineConfig({
plugins: [pluginBabel({ include: /\.(?:jsx|tsx|ts)$/ }), pluginSolid()],
source: {
alias: { "~": "./src" },
define: {
"import.meta.env.VERSION": JSON.stringify(
process.env.GITHUB_RUN_NUMBER || "0.0.1"
),
},
},
dev: {
hmr: true,
liveReload: true,
},
server: {
port: 3000,
},
tools: {
rspack: {
optimization: {
splitChunks: false,
runtimeChunk: false,
},
plugins:
process.env.NODE_ENV === "production"
? [
new BannerPlugin({
banner: () => "",
test: /\.js$/,
}),
new CompressionPlugin({
algorithm: "brotliCompress",
filename: "[path][base].br",
test: /\.(mjs|css)$/,
compressionOptions: {
level: 11,
},
threshold: 0,
minRatio: 1,
}),
]
: [],
},
},
output: {
inlineStyles: false,
filename: {
js: "app.mjs",
css: "app.css",
},
legalComments: "none",
},
});