@@ -23,7 +23,7 @@ export interface ArchitectCommandOptions extends BaseCommandOptions {
23
23
}
24
24
25
25
export abstract class ArchitectCommand <
26
- T extends ArchitectCommandOptions = ArchitectCommandOptions
26
+ T extends ArchitectCommandOptions = ArchitectCommandOptions ,
27
27
> extends Command < T > {
28
28
protected _architect ! : Architect ;
29
29
protected _architectHost ! : WorkspaceNodeModulesArchitectHost ;
@@ -238,7 +238,7 @@ export abstract class ArchitectCommand<
238
238
}
239
239
240
240
await this . reportAnalytics ( [ this . description . name ] , {
241
- ...( ( ( await this . _architectHost . getOptionsForTarget ( target ) ) as unknown ) as T ) ,
241
+ ...( ( await this . _architectHost . getOptionsForTarget ( target ) ) as unknown as T ) ,
242
242
...overrides ,
243
243
} ) ;
244
244
@@ -344,11 +344,18 @@ export abstract class ArchitectCommand<
344
344
project = commandOptions . project ;
345
345
target = this . target ;
346
346
if ( commandOptions . prod ) {
347
- // The --prod flag will always be the first configuration, available to be overwritten
348
- // by following configurations.
347
+ const defaultConfig =
348
+ project &&
349
+ target &&
350
+ this . workspace ?. projects . get ( project ) ?. targets . get ( target ) ?. defaultConfiguration ;
351
+
349
352
this . logger . warn (
350
- 'Option "--prod" is deprecated: Use "--configuration production" instead.' ,
353
+ defaultConfig === 'production'
354
+ ? 'Option "--prod" is deprecated: No need to use this option as this builder defaults to configuration "production".'
355
+ : 'Option "--prod" is deprecated: Use "--configuration production" instead.' ,
351
356
) ;
357
+ // The --prod flag will always be the first configuration, available to be overwritten
358
+ // by following configurations.
352
359
configuration = 'production' ;
353
360
}
354
361
if ( commandOptions . configuration ) {
0 commit comments