File tree Expand file tree Collapse file tree 4 files changed +12
-2
lines changed Expand file tree Collapse file tree 4 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -4,15 +4,16 @@ import { ModuleFederationPlugin } from '@module-federation/enhanced/rspack';
44
55export default defineConfig ( {
66 server : {
7- port : 3000 ,
7+ port : 3009 ,
88 } ,
99 tools : {
1010 rspack : ( config , { appendPlugins } ) => {
1111 appendPlugins ( [
1212 new ModuleFederationPlugin ( {
1313 name : 'host' ,
1414 remotes : {
15- remote1 : 'remote1@http://localhost:3001/mf-manifest.json' ,
15+ mfapp01 : "mfapp01@https://unpkg.com/mf-app-01@1.0.9/dist/remoteEntry.js" ,
16+ remote1 : 'remote1@http://localhost:3001/manifestpath/mf-manifest.json' ,
1617 remote2 : 'remote2@http://localhost:3002/mf-manifest.json' ,
1718 } ,
1819 shared : [ 'react' , 'react-dom' ] ,
Original file line number Diff line number Diff line change 11import React from 'react' ;
22import ReactDOM from 'react-dom/client' ;
33import App from './App' ;
4+ import aA from "mfapp01/App"
5+ console . log ( 222 , aA )
46
57const root = ReactDOM . createRoot ( document . getElementById ( 'root' ) ! ) ;
68root . render (
Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ export default defineConfig({
1616 appendPlugins ( [
1717 new ModuleFederationPlugin ( {
1818 name : 'remote1' ,
19+ remotes : {
20+ bbc : "http://localhost:5173/dd/remoteEntry.js" ,
21+ } ,
22+ remoteType : "module" ,
1923 exposes : {
2024 './button' : './src/button.tsx' ,
2125 './app' : './src/app.tsx' ,
Original file line number Diff line number Diff line change 1+ import bbc from "bbc/App"
2+ console . log ( 123 , bbc )
3+
14export default function Button ( ) {
25 return < div > remote2</ div > ;
36}
You can’t perform that action at this time.
0 commit comments