A rollup plugin for module federation.
npm install --save-dev rollup-plugin-module-federation
yarn add --dev rollup-plugin-module-federation
import federation from 'rollup-plugin-module-federation';
export default {
plugins: [
federation({
name: 'rr-random-package',
filename: 'my-remote-entry.js',
exposes: {
'./react': 'react',
'./pqr': './src/pqr.js',
'./index': './src/index.js',
},
shared: {
react: {},
'react-dom': {},
uuid: {},
},
}),
],
};
npm install
npm run build --workspaces --if-present
# Run the http server
npm run start
# Goto URL: http://localhost:8080/packages/examples/project-a/dist/rollup/esm/