Skip to content

Commit a529bc4

Browse files
chore: update rstack
1 parent 53bcbd9 commit a529bc4

File tree

1 file changed

+14
-22
lines changed

1 file changed

+14
-22
lines changed

examples/federation/epic-stack-remote/rsbuild.config.ts

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import type { Compiler } from '@rspack/core'
66

77
import 'react-router'
88

9-
// Define a custom webpack/rspack plugin
109
class RuntimePlugin {
1110
apply(compiler: Compiler) {
1211
const { RuntimeGlobals } = compiler.webpack;
@@ -18,7 +17,6 @@ class RuntimePlugin {
1817
if(module.name === "module_chunk_loading") {
1918
const interceptor =`
2019
console.log('test');
21-
// Track the current module URL
2220
var getModuleUrl = function() {
2321
console.log('Getting module URL', import.meta.url);
2422
return import.meta.url;
@@ -48,7 +46,6 @@ export default defineConfig({
4846
tools: {
4947
rspack: {
5048
devtool: false,
51-
// plugins: [new RuntimePlugin()]
5249
}
5350
},
5451
environments: {
@@ -66,10 +63,8 @@ export default defineConfig({
6663
library: {
6764
type: 'module'
6865
},
69-
// remoteType: 'module',
7066
runtime: false,
7167
exposes: {
72-
// Root components
7368
'./components/search-bar': './app/components/search-bar',
7469
'./components/user-dropdown': './app/components/user-dropdown',
7570
'./components/spacer': './app/components/spacer',
@@ -109,14 +104,11 @@ export default defineConfig({
109104
type: 'commonjs-module'
110105
},
111106
dts: false,
112-
// getPublicPath: 'console.log(__webpack_require__), return "http://localhost:3001/"',
113107
runtimePlugins: [
114108
'@module-federation/node/runtimePlugin'
115109
],
116-
// remoteType: 'module',
117110
runtime: false,
118111
exposes: {
119-
// Root components
120112
'./components/search-bar': './app/components/search-bar',
121113
'./components/user-dropdown': './app/components/user-dropdown',
122114
'./components/spacer': './app/components/spacer',
@@ -127,20 +119,20 @@ export default defineConfig({
127119
'./components/progress-bar': './app/components/progress-bar',
128120

129121
},
130-
// shared: {
131-
// react: {
132-
// singleton: true,
133-
// },
134-
// 'react/jsx-dev-runtime': {
135-
// singleton: true,
136-
// },
137-
// 'react/jsx-runtime': {
138-
// singleton: true,
139-
// },
140-
// 'react-dom': {
141-
// singleton: true,
142-
// },
143-
// }
122+
shared: {
123+
react: {
124+
singleton: true,
125+
},
126+
'react/jsx-dev-runtime': {
127+
singleton: true,
128+
},
129+
'react/jsx-runtime': {
130+
singleton: true,
131+
},
132+
'react-dom': {
133+
singleton: true,
134+
},
135+
}
144136
})
145137
]
146138
}

0 commit comments

Comments
 (0)