Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Commit f59c9a1

Browse files
committed
fix(@angular-devkit/build-angular): make serve build options override
Fixes: angular/angular-cli#10886
1 parent 2f7d427 commit f59c9a1

File tree

1 file changed

+9
-9
lines changed
  • packages/angular_devkit/build_angular/src/dev-server

1 file changed

+9
-9
lines changed

packages/angular_devkit/build_angular/src/dev-server/index.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -436,14 +436,12 @@ export class DevServerBuilder implements Builder<DevServerBuilderOptions> {
436436
private _getBrowserOptions(options: DevServerBuilderOptions) {
437437
const architect = this.context.architect;
438438
const [project, target, configuration] = options.browserTarget.split(':');
439-
// Override browser build watch setting.
440-
const overrides = { watch: options.watch };
441-
const browserTargetSpec = { project, target, configuration, overrides };
442-
const builderConfig = architect.getBuilderConfiguration<BrowserBuilderSchema>(
443-
browserTargetSpec);
444439

445-
// Update the browser options with the same options we support in serve, if defined.
446-
builderConfig.options = {
440+
const overrides = {
441+
// Override browser build watch setting.
442+
watch: options.watch,
443+
444+
// Update the browser options with the same options we support in serve, if defined.
447445
...(options.optimization !== undefined ? { optimization: options.optimization } : {}),
448446
...(options.aot !== undefined ? { aot: options.aot } : {}),
449447
...(options.sourceMap !== undefined ? { sourceMap: options.sourceMap } : {}),
@@ -453,10 +451,12 @@ export class DevServerBuilder implements Builder<DevServerBuilderOptions> {
453451
...(options.baseHref !== undefined ? { baseHref: options.baseHref } : {}),
454452
...(options.progress !== undefined ? { progress: options.progress } : {}),
455453
...(options.poll !== undefined ? { poll: options.poll } : {}),
456-
457-
...builderConfig.options,
458454
};
459455

456+
const browserTargetSpec = { project, target, configuration, overrides };
457+
const builderConfig = architect.getBuilderConfiguration<BrowserBuilderSchema>(
458+
browserTargetSpec);
459+
460460
return architect.getBuilderDescription(builderConfig).pipe(
461461
concatMap(browserDescription =>
462462
architect.validateBuilderOptions(builderConfig, browserDescription)),

0 commit comments

Comments
 (0)