Skip to content

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
Development

Successfully merging this pull request may close these issues.

ng serve uses sourcemaps even when they are turned off angular.json: sourceMap.vendor-option in build has no affect on serve
4 participants