Skip to content

Commit 73ec47e

Browse files
committed
Step 2 - Address schema validation error in nx run host-application:serve due to @angular-devkit/build-angular:dev-server quirks
1 parent 2206911 commit 73ec47e

File tree

1 file changed

+14
-3
lines changed
  • libs/nx-angular-mf/src/builders/serve

1 file changed

+14
-3
lines changed

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111

1212
import { ServeExecutorSchema } from './schema';
1313
import { BuildExecutorSchema } from '../build/schema';
14-
import { deepMergeObject, prepareConfig } from '../helpers';
14+
import { deepMergeObject, getMapName, prepareConfig } from '../helpers';
1515

1616

1717
function getBuilderAction() {
@@ -32,14 +32,16 @@ export async function* runBuilder(
3232
) {
3333
context.logger.info('Run serve mf');
3434

35+
const {mf: defaultOptionsMfe, ...defaultOptions} = options;
36+
3537
const buildTarget = targetFromTargetString(options.buildTarget);
3638
const targetOptions = (await context.getTargetOptions(
3739
buildTarget
3840
)) as unknown as BuildExecutorSchema;
3941

4042
const resultMfeOptions = deepMergeObject(
4143
targetOptions['mf'] || {},
42-
options.mf || {}
44+
defaultOptionsMfe || {}
4345
);
4446

4547
const optionsMfe = await prepareConfig(
@@ -48,10 +50,19 @@ export async function* runBuilder(
4850
context
4951
);
5052

53+
const mapShareObject = getMapName(
54+
optionsMfe.shared,
55+
optionsMfe.sharedMappings
56+
);
57+
58+
const externalDependencies = [...mapShareObject.values()].map(
59+
(i) => i.packageName
60+
);
61+
5162
const normalizeOuterOptions = await normalizeOptions(
5263
context,
5364
context.target.project,
54-
options as any
65+
defaultOptions
5566
);
5667

5768
const extensions = {

0 commit comments

Comments
 (0)