generated from NEARBuilders/project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrsbuild.config.ts
56 lines (55 loc) · 1.31 KB
/
rsbuild.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
import { pluginModuleFederation } from "@module-federation/rsbuild-plugin";
import { defineConfig } from "@rsbuild/core";
import { pluginReact } from "@rsbuild/plugin-react";
// import { TanStackRouterRspack } from '@tanstack/router-plugin/rspack';
export default defineConfig({
html: {
template: "./index.html",
},
source: {
entry: {
index: "./src/index.tsx",
},
},
server: {
port: 5170,
},
output: {
distPath: {
root: "dist",
},
},
// tools: {
// rspack: {
// plugins: [
// TanStackRouterRspack({
// routesDirectory: "./src/routes",
// enableRouteGeneration: true
// }),
// ]
// }
// },
plugins: [
pluginReact(),
pluginModuleFederation({
name: "profile",
filename: "profile/remoteEntry.js",
exposes: {
// Expose the Profile component for module federation
"./Profile": "./src/components/Profile.tsx",
},
experiments: {
federationRuntime: "hoisted",
},
shared: {
react: { singleton: true, eager: true, requiredVersion: "^18.0.0" },
"react-dom": {
singleton: true,
eager: true,
requiredVersion: "^18.0.0",
},
"@tanstack/react-router": { singleton: true, eager: true },
},
}),
],
});