Skip to content

Commit a5877bf

Browse files
alan-agius4filipesilva
authored andcommitted
feat(@angular/cli): deprecate --prod command line argument
With this change we deprecated the `--prod` command line argument. This argument is confusing especially to new users, since users expect that this builds an application in production mode. This however, is only an alias for `--configuration="production"`
1 parent 5f8155d commit a5877bf

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

packages/angular/cli/commands/build-long.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ When used to build a library, a different builder is invoked, and only the `ts-c
33
All other options apply only to building applications.
44

55
The application builder uses the [webpack](https://webpack.js.org/) build tool, with default configuration options specified in the workspace configuration file (`angular.json`) or with a named alternative configuration.
6-
A "production" configuration is created by default when you use the CLI to create the project, and you can use that configuration by specifying the `--configuration="production"` or the `--prod` option.
6+
A "development" configuration is created by default when you use the CLI to create the project, and you can use that configuration by specifying the `--configuration development`.
77

88
The configuration options generally correspond to the command options.
99
You can override individual configuration defaults by specifying the corresponding options on the command line.

packages/angular/cli/commands/definitions.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
},
2323
"prod": {
2424
"description": "Shorthand for \"--configuration=production\".\nSet the build configuration to the production target.\nBy default, the production target is set up in the workspace configuration such that all builds make use of bundling, limited tree-shaking, and also limited dead code elimination.",
25-
"type": "boolean"
25+
"type": "boolean",
26+
"x-deprecated": "Use `--configuration production` instead."
2627
}
2728
}
2829
},

packages/angular/cli/models/architect-command.ts

+1
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ export abstract class ArchitectCommand<
328328
if (commandOptions.prod) {
329329
// The --prod flag will always be the first configuration, available to be overwritten
330330
// by following configurations.
331+
this.logger.warn('Option "--prod" is deprecated: Use "--configuration production" instead.');
331332
configuration = 'production';
332333
}
333334
if (commandOptions.configuration) {

0 commit comments

Comments
 (0)