Is it possible to create extra .prod environment and to run command like:
"ng build --prod --configuration new_environment" .
I want to have optimised files.
Yes you can do this. Just don't use the --prod flag.
"ng build --configuration my_special_config"
in angular.json add "my_special_config"
If you wanted to apply everything that you've configured already for the production build, but overwrite/add some settings then still create it in angular.json and then:
Thanks for your comment @kinaski
!
Unfortunately as far I know, you cannot do this! If you can see the official documentation, setting the --configuration option explicitly overrides the --prod flag.
For more information, see: angular.io/cli/build#options
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Is it possible to create extra .prod environment and to run command like:
"ng build --prod --configuration new_environment" .
I want to have optimised files.
Yes you can do this. Just don't use the --prod flag.
"ng build --configuration my_special_config"
in angular.json add "my_special_config"
If you wanted to apply everything that you've configured already for the production build, but overwrite/add some settings then still create it in angular.json and then:
"ng build --configuration production, my_special_config"
See angular.io/guide/workspace-config#...
Thanks for your comment @kinaski !
Unfortunately as far I know, you cannot do this! If you can see the official documentation, setting the
--configuration
option explicitly overrides the--prod
flag.For more information, see: angular.io/cli/build#options