Awesome
@angular-architects/module-federation
Local Development
<details> <summary>Playground App</summary>You can test directly the libraries by using the playground application:
- Start the
host
application:npx nx run playground:serve
- Start the
remote
application:npx nx run mfe1:serve --port 3001
By using that approach you can test your modifications on the libraries.
</details> <details> <summary>Test Library on external repository</summary>If you want to test the modifications directly on your application, you can follow the steps:
- Start the local registry Verdaccio:
npx nx run local-registry
- Then you can publish the libraries by using:
-
For Module federation:
npm run publish-local:mf
-
For Native federation:
npm run publish-local:nf
This will first
build
the libraries andpublish
them to http://localhost:4873
- Then just re-run the
install
on the other repo with you favorite package manager.
By default, the version from the package.json
will be used. However, you can provide the version for a specific library by using:
npx nx run native-federation:publish-local -- --ver=17.0.8
</details>
<details>
<summary>Publish Libraries</summary>
Follow these steps to publish all libraries on npm
:
- For Module federation:
npm run publish:mf
- For Native federation:
This will firstnpm run publish:nf
build
the libraries andpublish
them tonpm registry
.
By default, the version from the package.json
will be used and the tag will be next
. However, you can provide the version and the tag for a specific library by using:
npx nx run native-federation:publish -- --ver=17.0.8 --tag=latest
</details>