Firstly, run ng serve
for running the remote app. Navigate to http://localhost:4300/
. The application will automatically reload if you change any of the source files.
- Update
src/assets/module-federation.manifest.json
{
"remote-app": "http://localhost:4300/remoteEntry.js"
}
- Update
src/app/app-routing.module.ts
import { loadRemoteModule } from '@nx/angular/mf';
...
const routes: Routes = [
{
path: 'plugin',
loadChildren: () =>
loadRemoteModule('remote-app', './Module').then((m) => m.RemotePluginModule)
},
-
Run your host app and visit: https://localhost:4200/#/plugin