I'm trying to load a Micro Frontend as a webcomponent, following this tutorial from angulararchitects.
Configuration in my Shell app :
main.ts
initFederation('/appconf/mf.manifest.json')
.catch(err => console.error(err))
.then(() => import('./bootstrap'))
.catch(err => console.error(err));
bootstrap.ts
bootstrap(AppModule, {
production: false,
appType: 'shell'
}).catch((err) => console.error(err));;
app-routing.module.ts : working
{
matcher: startsWith('mfe1'),
component: WebComponentWrapper,
data: {
type: 'module',
remoteEntry: 'http://localhost:4201/remoteEntry.js',
exposedModule: './web-component',
elementName: 'app-mfe1'
} as WebComponentWrapperOptions
},
app-routing.module.ts : not working
{
matcher: startsWith('mfe1'),
component: WebComponentWrapper,
data: {
type: 'manifest',
remoteName: 'mfe1',
exposedModule: './web-component',
elementName: 'app-mfe1'
} as WebComponentWrapperOptions
}
My manifest is loaded (I can see it in the network tab).
But I have the following error with this configuration (type 'manifest'):
Manifest does not contain mfe1
mf.manifest.json
{
"mfe1": {
"remoteEntry": "http://localhost:4201/remoteEntry.js"
}
}
Do you know the syntaxe to use a webcomponent with a manifest ?