-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathrsbuild.config.ts
More file actions
41 lines (40 loc) · 1.08 KB
/
rsbuild.config.ts
File metadata and controls
41 lines (40 loc) · 1.08 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
import { defineConfig } from '@rsbuild/core';
import { pluginReact } from '@rsbuild/plugin-react';
import { pluginReactRouter } from 'rsbuild-plugin-react-router';
export default defineConfig({
environments: {
node: {
performance: {
// cloudflare cannot support dynamic chunk split in worker
chunkSplit: { strategy: 'all-in-one' },
},
tools: {
rspack: {
// must use esm module output
experiments: {
outputModule: true,
},
externalsType: 'module',
output: {
chunkFormat: 'module',
chunkLoading: 'import',
workerChunkLoading: 'import',
wasmLoading: 'fetch',
library: { type: 'module' },
module: true,
},
resolve: {
conditionNames: [
'workerd',
'worker',
'browser',
'import',
'require',
],
},
},
},
},
},
plugins: [pluginReactRouter({customServer: true}), pluginReact()],
});