We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4b48eb5 commit ed072f9Copy full SHA for ed072f9
packages/rsbuild-plugin/src/cli/index.ts
@@ -177,6 +177,12 @@ export const pluginModuleFederation = (
177
// Change some default configs for remote modules
178
if (moduleFederationOptions.exposes) {
179
config.dev ||= {};
180
+ config.server ||= {};
181
+
182
+ // Allow remote modules to be loaded by setting CORS headers
183
+ // This is required for MF to work properly across different origins
184
+ config.server.headers ||= {};
185
+ config.server.headers['Access-Control-Allow-Origin'] ||= '*';
186
187
// For remote modules, Rsbuild should send the ws request to the provider's dev server.
188
// This allows the provider to do HMR when the provider module is loaded in the consumer's page.
0 commit comments