-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: target right package version for Micro Frontends (#126)
- Loading branch information
1 parent
a5d6486
commit 6d6d630
Showing
1 changed file
with
9 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,12 +41,12 @@ $ npx @angular/cli@14 add @angular-architects/[email protected] --projec | |
|
||
3. Add [@angular/elements](https://angular.io/guide/elements) to create custom components. | ||
```shell | ||
$ npm i @angular/elements@12.2.17 | ||
$ npm i @angular/elements@14.3.0 | ||
``` | ||
|
||
4. Add [@angular-architects/module-federation-tools](https://www.npmjs.com/package/@angular-architects/module-federation-tools) to reduce boilerplate code. | ||
```shell | ||
$ npm i @angular-architects/module-federation-tools@12.5.3 | ||
$ npm i @angular-architects/module-federation-tools@14.3.14 | ||
``` | ||
|
||
5. The plugin creates a Webpack configuration `webpack.config.js` which you need to adjust: | ||
|
@@ -101,13 +101,13 @@ export class AppModule { | |
``` | ||
### Convert the existing app | ||
|
||
Add the plugin to the existing app in Angular 12 that acts as the shell. | ||
1. The existing app in Angular 12 acts as the shell. Add the plugin to configure it. | ||
```shell | ||
$ npx @angular/cli@12 add @angular-architects/[email protected] --project yourProject | ||
``` | ||
NOTE: Replace `yourProject` with the name of your project. | ||
|
||
And adjust the resulting `webpack.config.js` as needed: | ||
2. Adjust the resulting `webpack.config.js` as needed: | ||
```js | ||
const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin'); | ||
|
||
|
@@ -125,6 +125,11 @@ module.exports = { | |
} | ||
``` | ||
|
||
3. Add [@angular-architects/module-federation-tools](https://www.npmjs.com/package/@angular-architects/module-federation-tools): | ||
```shell | ||
$ npm i @angular-architects/[email protected] | ||
``` | ||
|
||
### Routing between the shell and the remote | ||
|
||
Routing needs to be specifically handled between both apps. | ||
|