Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/angular-architects/module-federation-plugin
https://github.com/angular-architects/module-federation-plugin
Last synced: 24 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/angular-architects/module-federation-plugin
- Owner: angular-architects
- License: mit
- Created: 2020-10-10T22:54:08.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-20T13:47:51.000Z (about 2 months ago)
- Last Synced: 2024-10-30T01:03:18.804Z (about 1 month ago)
- Language: TypeScript
- Size: 6.95 MB
- Stars: 728
- Watchers: 32
- Forks: 197
- Open Issues: 293
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-angular - module-federation-plugin - Module Federation allows loading separately compiled and deployed code (like micro frontends or plugins) into an application. This plugin makes Module Federation work together with Angular and the CLI. (Table of contents / Third Party Components)
- fucking-awesome-angular - module-federation-plugin - Module Federation allows loading separately compiled and deployed code (like micro frontends or plugins) into an application. This plugin makes Module Federation work together with Angular and the CLI. (Table of contents / Third Party Components)
README
# @angular-architects/module-federation
- [Readme for Module Federation](./libs/mf/README.md)
- [Readme for Native Federation](./libs/native-federation/README.md)## Local Development
Playground App
You can test directly the libraries by using the playground application:
1. Start the `host` application:
```shell
npx nx run playground:serve
```
2. Start the `remote` application:
```shell
npx nx run mfe1:serve --port 3001
```By using that approach you can test your modifications on the libraries.
Test Library on external repository
If you want to test the modifications directly on your application, you can follow the steps:
1. Start the local registry [Verdaccio](https://verdaccio.org/):
```shell
npx nx run local-registry
```
2. Then you can publish the libraries by using:- For Module federation:
```shell
npm run publish-local:mf
```
- For Native federation:```shell
npm run publish-local:nf
```This will first `build` the libraries and `publish` them to [http://localhost:4873](http://localhost:4873)
3. 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:
```shell
npx nx run native-federation:publish-local -- --ver=17.0.8
```Publish Libraries
Follow these steps to publish all libraries on `npm`:
- For Module federation:
```shell
npm run publish:mf
```
- For Native federation:
```shell
npm run publish:nf
```
This will first `build` the libraries and `publish` them to `npm 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:
```shell
npx nx run native-federation:publish -- --ver=17.0.8 --tag=latest
```