-
-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathrsbuild.config.ts
More file actions
27 lines (25 loc) · 736 Bytes
/
rsbuild.config.ts
File metadata and controls
27 lines (25 loc) · 736 Bytes
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
import { defineConfig } from "@rsbuild/core";
import { pluginReact } from "@rsbuild/plugin-react";
import { pluginSvgr } from "@rsbuild/plugin-svgr";
import { execSync } from "node:child_process";
const commitHash = execSync("git rev-parse --short HEAD").toString().trim();
export default defineConfig({
plugins: [pluginReact(), pluginSvgr({ mixedImport: true })],
server: {
base: process.env.PUBLIC_URL,
},
source: {
define: {
"process.env.RSTEST": process.env.RSTEST,
"__COMMIT_HASH__": JSON.stringify(commitHash),
},
},
html: {
template: "./public/index.html",
},
output: {
distPath: {
root: "build",
},
},
});