Skip to content

fix(@angular-devkit/build-angular): serve option merging is being overridden by defaults in schema #15328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 15, 2019
Merged

Conversation

alan-agius4
Copy link
Collaborator

@alan-agius4 alan-agius4 commented Aug 14, 2019

We have a number of browser options that we allow the dev-server to merge. However, this only happens when such as options are undefined from the dev-server builder. At the moment these option have defaults inside their schema which results in them never being undefined, and hence the overridden logic is bypassed.

See:

export const devServerBuildOverriddenKeys: (keyof DevServerBuilderOptions)[] = [
'watch',
'optimization',
'aot',
'sourceMap',
'vendorSourceMap',
'evalSourceMap',
'vendorChunk',
'commonChunk',
'baseHref',
'progress',
'poll',
'verbose',
'deployUrl',
];
and
const overrides = (Object.keys(options) as (keyof DevServerBuilderOptions)[])
.filter(key => options[key] !== undefined && devServerBuildOverriddenKeys.includes(key))
.reduce<json.JsonObject & Partial<BrowserBuilderSchema>>(
(previous, key) => ({
...previous,
[key]: options[key],
}),
{},
);

Fixes #15273 and fixes #15064

@alan-agius4 alan-agius4 added the target: patch This PR is targeted for the next patch release label Aug 14, 2019
@alan-agius4 alan-agius4 changed the title fix(@angular-devkit/build-angular): serve soucemap option merging is … fix(@angular-devkit/build-angular): serve option merging is being overridden by defaults in schema Aug 14, 2019
…rridden by defaults in schema

We have a number of browser options that we allow the dev-server to merge. However, this only happens when such as options are undefined from the dev-server builder. At the moment these option have defaults inside their schema which results in them never being `undefined`, and hence the overridden logic is bypassed.

See: https://github.com/angular/angular-cli/blob/6dd5b186d4dc0ed750cc195d9ebe1aaa282bb640/packages/angular_devkit/build_angular/src/dev-server/index.ts#L49-L63 and https://github.com/angular/angular-cli/blob/6dd5b186d4dc0ed750cc195d9ebe1aaa282bb640/packages/angular_devkit/build_angular/src/dev-server/index.ts#L107-L115

Fixes #15273 and fixes #15064
@mgechev mgechev merged commit f2ecb90 into angular:master Aug 15, 2019
mgechev pushed a commit that referenced this pull request Aug 15, 2019
…rridden by defaults in schema (#15328)

We have a number of browser options that we allow the dev-server to merge. However, this only happens when such as options are undefined from the dev-server builder. At the moment these option have defaults inside their schema which results in them never being `undefined`, and hence the overridden logic is bypassed.

See: https://github.com/angular/angular-cli/blob/6dd5b186d4dc0ed750cc195d9ebe1aaa282bb640/packages/angular_devkit/build_angular/src/dev-server/index.ts#L49-L63 and https://github.com/angular/angular-cli/blob/6dd5b186d4dc0ed750cc195d9ebe1aaa282bb640/packages/angular_devkit/build_angular/src/dev-server/index.ts#L107-L115

Fixes #15273 and fixes #15064
This was referenced Aug 15, 2019
This was referenced Aug 15, 2019
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
target: patch This PR is targeted for the next patch release
Projects
None yet
4 participants