I am using Angular 7 and I wonder if
ng serve --prod
is the same as
ng serve -c production
Can't find that in the documentation so any help would be appreciated
I am using Angular 7 and I wonder if
ng serve --prod
is the same as
ng serve -c production
Can't find that in the documentation so any help would be appreciated
There is some documentation on it here: https://angular.io/cli/build
It says that -c
is the alias for --configuration
A named build target, as specified in the "configurations" section of angular.json. Each named target is accompanied by a configuration of option defaults for that target.
Aliases: -c
The documentation for --prod
says:
When true, sets the build configuration to the production target. All builds make use of bundling and limited tree-shaking. A production build also runs limited dead code elimination.
So it sounds to me like the same thing.
In Angular 16, both are not the same.
ng serve --prod
The above command throws error -
Error: Unknown argument: prod
However, ng serve -c production
works as expected with the following output.
Warning: 'outputHashing' option is disabled when using the dev-server. **************************************************************************************** This is a simple server for use in testing or debugging Angular applications locally. It hasn't been reviewed for security issues.
DON'T USE IT FOR PRODUCTION! **************************************************************************************** ✔ Browser application bundle generation complete.
You can verify by checking the size of the chunk files. It should be significantly less than the dev build.
© 2022 - 2024 — McMap. All rights reserved.