Skip to content

Commit 2035a7f

Browse files
author
Alain BOUDARD
committed
fix: set shared packages for mfe 1
1 parent 07d7c1f commit 2035a7f

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This is a demo project for Spring Boot with Module Federation and Angular.
44

55
## How to run
66

7-
The project hosts a sungle Spring Boot application.
7+
The project hosts a single Spring Boot application.
88
The `/application` folder contains the Angular application.
99
The `/library` folder contains a micro frontend application.
1010

library/ng-mfe1/webpack.config.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { shareAll, withModuleFederationPlugin } = require('@angular-architects/module-federation/webpack');
1+
const { share, withModuleFederationPlugin } = require('@angular-architects/module-federation/webpack');
22

33
module.exports = withModuleFederationPlugin({
44

@@ -8,8 +8,12 @@ module.exports = withModuleFederationPlugin({
88
'./Module': './src/app/orders/orders.module.ts',
99
},
1010

11-
shared: {
12-
...shareAll({ singleton: true, strictVersion: true, requiredVersion: 'auto' }),
13-
},
11+
// Explicitly share packages:
12+
shared: share({
13+
"@angular/core": { singleton: true, strictVersion: true, requiredVersion: 'auto' },
14+
"@angular/common": { singleton: true, strictVersion: true, requiredVersion: 'auto' },
15+
"@angular/common/http": { singleton: true, strictVersion: true, requiredVersion: 'auto' },
16+
"@angular/router": { singleton: true, strictVersion: true, requiredVersion: 'auto' },
17+
}),
1418

1519
});

0 commit comments

Comments
 (0)