import { pluginModuleFederation } from '@module-federation/rsbuild-plugin';
import { defineConfig } from '@rslib/core';
export default defineConfig({
lib: [
// ...
{
format: 'mf',
output: {
distPath: {
root: './dist/mf',
},
assetPrefix: 'xxx',
},
plugins: [
// ...
pluginModuleFederation({
name: 'rslib_provider',
exposes: {
'.': './src/index.tsx',
},
shared: {
react: {
singleton: true,
},
'react-dom': {
singleton: true,
},
},
}),
],
},
],
});