mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-15 18:13:38 +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 {
|
||||
builder: string;
|
||||
configurations?: Record<string, Record<string, JsonValue | undefined> | undefined>;
|
||||
defaultConfiguration?: string;
|
||||
options?: Record<string, JsonValue | undefined>;
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ export interface ProjectDefinition {
|
||||
export interface TargetDefinition {
|
||||
options?: Record<string, JsonValue | undefined>;
|
||||
configurations?: Record<string, Record<string, JsonValue | undefined> | undefined>;
|
||||
|
||||
defaultConfiguration?: string;
|
||||
builder: string;
|
||||
}
|
||||
|
||||
@ -234,6 +234,7 @@ export class TargetDefinitionCollection extends DefinitionCollection<TargetDefin
|
||||
builder: definition.builder,
|
||||
options: definition.options,
|
||||
configurations: definition.configurations,
|
||||
defaultConfiguration: definition.defaultConfiguration,
|
||||
};
|
||||
|
||||
super.set(definition.name, target);
|
||||
|
@ -294,7 +294,7 @@ function parseTargetsObject(
|
||||
const name = key.value;
|
||||
if (context.trackChanges) {
|
||||
targets[name] = createVirtualAstObject<TargetDefinition>(value, {
|
||||
include: [ 'builder', 'options', 'configurations' ],
|
||||
include: [ 'builder', 'options', 'configurations', 'defaultConfiguration' ],
|
||||
listener(op, path, node, value) {
|
||||
jsonMetadata.addChange(
|
||||
op,
|
||||
|
@ -104,6 +104,9 @@ function convertJsonTarget(target: TargetDefinition): JsonObject {
|
||||
...(isEmpty(target.configurations)
|
||||
? {}
|
||||
: { configurations: target.configurations as JsonObject }),
|
||||
...(target.defaultConfiguration === undefined
|
||||
? {}
|
||||
: { defaultConfiguration: target.defaultConfiguration }),
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user