Skip to content

Commit 2206911

Browse files
committed
Step 2 - Determine entry points for dependencies; use NF tools to list external dependencies and update Angular config. Validate with successful build.
1 parent 4beff95 commit 2206911

File tree

10 files changed

+467
-6
lines changed

10 files changed

+467
-6
lines changed

build-skip-list.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
"@angular/core/testing",
1818
"@angular/ssr/node",
1919
"rxjs/testing",
20-
"@klerick/native-federation-ssr",
20+
"@klerick/nx-angular-mf",
2121
"@angular/platform-server/init"
2222
]

libs/nx-angular-mf/src/builders/build/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { BuilderContext, createBuilder } from '@angular-devkit/architect';
22
import { buildApplication } from '@angular-devkit/build-angular';
33

44
import { BuildExecutorSchema } from './schema';
5+
import { getMapName, prepareConfig } from '../helpers';
56

67

78
export async function* runBuilder(
@@ -12,6 +13,17 @@ export async function* runBuilder(
1213

1314
const { mf: defaultOptionsMfe, ...defaultOptions } = options;
1415

16+
const optionsMfe = await prepareConfig(defaultOptionsMfe, options, context);
17+
18+
const mapShareObject = getMapName(
19+
optionsMfe.shared,
20+
optionsMfe.sharedMappings
21+
);
22+
23+
defaultOptions.externalDependencies = [...mapShareObject.values()].map(
24+
(i) => i.packageName
25+
);
26+
1527
const extensions = {
1628
codePlugins: [],
1729
indexHtmlTransformer: (input) => {

libs/nx-angular-mf/src/builders/build/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@
646646
"server"
647647
]
648648
},
649-
"mfe": {
649+
"mf": {
650650
"type": "object",
651651
"properties": {
652652
"externalList": {

0 commit comments

Comments
 (0)