In your example, does the feature.module.ts have a component with a router outlet and a router module declaration for forChild([...])? By exposing feature.module.ts in your remote's webpack config, you should be able to something similar to this in your shell/root's app routing module:
This should lazy-load your remote app's feature module contents when navigating to /feature-path and then defer to that module's structure for further nested lazy loading. I've done something similar where my shell loads different authentication experiences under the /authentication namespace and certain auth experiences have further lazy loading for forgot password & user registration screens.
If you can statically declare the module federation information, it's much easier. Otherwise, you'll have to have that information in a config and pass static tokens into the app module of the shell and override the ROUTES token as shown above.
If you eco-system is small enough or not having live reloading against the remote isn't a deal breaker, you can federate the AppModule from the remote and not run into any issues.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
In your example, does the
feature.module.ts
have a component with a router outlet and a router module declaration forforChild([...])
? By exposingfeature.module.ts
in your remote's webpack config, you should be able to something similar to this in your shell/root's app routing module:This should lazy-load your remote app's feature module contents when navigating to
/feature-path
and then defer to that module's structure for further nested lazy loading. I've done something similar where my shell loads different authentication experiences under the/authentication
namespace and certain auth experiences have further lazy loading for forgot password & user registration screens.If you can statically declare the module federation information, it's much easier. Otherwise, you'll have to have that information in a config and pass static tokens into the app module of the shell and override the
ROUTES
token as shown above.If you eco-system is small enough or not having live reloading against the remote isn't a deal breaker, you can federate the
AppModule
from the remote and not run into any issues.