Skip to content
This repository has been archived by the owner on Apr 9, 2022. It is now read-only.

Commit

Permalink
fix(@angular-devkit/build-angular): make serve build options override
Browse files Browse the repository at this point in the history
  • Loading branch information
clydin committed May 29, 2018
1 parent 2f7d427 commit f59c9a1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions packages/angular_devkit/build_angular/src/dev-server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,14 +436,12 @@ export class DevServerBuilder implements Builder<DevServerBuilderOptions> {
private _getBrowserOptions(options: DevServerBuilderOptions) {
const architect = this.context.architect;
const [project, target, configuration] = options.browserTarget.split(':');
// Override browser build watch setting.
const overrides = { watch: options.watch };
const browserTargetSpec = { project, target, configuration, overrides };
const builderConfig = architect.getBuilderConfiguration<BrowserBuilderSchema>(
browserTargetSpec);

// Update the browser options with the same options we support in serve, if defined.
builderConfig.options = {
const overrides = {
// Override browser build watch setting.
watch: options.watch,

// Update the browser options with the same options we support in serve, if defined.
...(options.optimization !== undefined ? { optimization: options.optimization } : {}),
...(options.aot !== undefined ? { aot: options.aot } : {}),
...(options.sourceMap !== undefined ? { sourceMap: options.sourceMap } : {}),
Expand All @@ -453,10 +451,12 @@ export class DevServerBuilder implements Builder<DevServerBuilderOptions> {
...(options.baseHref !== undefined ? { baseHref: options.baseHref } : {}),
...(options.progress !== undefined ? { progress: options.progress } : {}),
...(options.poll !== undefined ? { poll: options.poll } : {}),

...builderConfig.options,
};

const browserTargetSpec = { project, target, configuration, overrides };
const builderConfig = architect.getBuilderConfiguration<BrowserBuilderSchema>(
browserTargetSpec);

return architect.getBuilderDescription(builderConfig).pipe(
concatMap(browserDescription =>
architect.validateBuilderOptions(builderConfig, browserDescription)),
Expand Down

0 comments on commit f59c9a1

Please sign in to comment.