mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-16 02:24:10 +08:00
feat(@angular-devkit/core): add handling for defaultConfiguration
target definition property
This commit is contained in:
parent
1da359ac08
commit
8e981d0880
@ -978,6 +978,7 @@ export declare class SynchronousDelegateExpectedException extends BaseException
|
|||||||
export interface TargetDefinition {
|
export interface TargetDefinition {
|
||||||
builder: string;
|
builder: string;
|
||||||
configurations?: Record<string, Record<string, JsonValue | undefined> | undefined>;
|
configurations?: Record<string, Record<string, JsonValue | undefined> | undefined>;
|
||||||
|
defaultConfiguration?: string;
|
||||||
options?: Record<string, JsonValue | undefined>;
|
options?: Record<string, JsonValue | undefined>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ export interface ProjectDefinition {
|
|||||||
export interface TargetDefinition {
|
export interface TargetDefinition {
|
||||||
options?: Record<string, JsonValue | undefined>;
|
options?: Record<string, JsonValue | undefined>;
|
||||||
configurations?: Record<string, Record<string, JsonValue | undefined> | undefined>;
|
configurations?: Record<string, Record<string, JsonValue | undefined> | undefined>;
|
||||||
|
defaultConfiguration?: string;
|
||||||
builder: string;
|
builder: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,6 +234,7 @@ export class TargetDefinitionCollection extends DefinitionCollection<TargetDefin
|
|||||||
builder: definition.builder,
|
builder: definition.builder,
|
||||||
options: definition.options,
|
options: definition.options,
|
||||||
configurations: definition.configurations,
|
configurations: definition.configurations,
|
||||||
|
defaultConfiguration: definition.defaultConfiguration,
|
||||||
};
|
};
|
||||||
|
|
||||||
super.set(definition.name, target);
|
super.set(definition.name, target);
|
||||||
|
@ -294,7 +294,7 @@ function parseTargetsObject(
|
|||||||
const name = key.value;
|
const name = key.value;
|
||||||
if (context.trackChanges) {
|
if (context.trackChanges) {
|
||||||
targets[name] = createVirtualAstObject<TargetDefinition>(value, {
|
targets[name] = createVirtualAstObject<TargetDefinition>(value, {
|
||||||
include: [ 'builder', 'options', 'configurations' ],
|
include: [ 'builder', 'options', 'configurations', 'defaultConfiguration' ],
|
||||||
listener(op, path, node, value) {
|
listener(op, path, node, value) {
|
||||||
jsonMetadata.addChange(
|
jsonMetadata.addChange(
|
||||||
op,
|
op,
|
||||||
|
@ -104,6 +104,9 @@ function convertJsonTarget(target: TargetDefinition): JsonObject {
|
|||||||
...(isEmpty(target.configurations)
|
...(isEmpty(target.configurations)
|
||||||
? {}
|
? {}
|
||||||
: { configurations: target.configurations as JsonObject }),
|
: { configurations: target.configurations as JsonObject }),
|
||||||
|
...(target.defaultConfiguration === undefined
|
||||||
|
? {}
|
||||||
|
: { defaultConfiguration: target.defaultConfiguration }),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user