See Angular – Configure Environment Specific Defaults
EDIT:- As predicted, GitHub Issue
After the release of Angular CLI 15.1, a generation schematic will be available to add environment files for all existing build configurations within a project.
Example usage:
ng g environments
To manually create:
If you want to recreate environments, follow these steps:
-
Create
environmentsdirectory -
Create your custom environments
environment.tsenvironment.prod.tsenvironment.staging.tsetc.
-
Update your
angular.jsonorproject.jsonto dofileReplacementswhere the paths are from project root to the environment file forreplaceandwith:
"configurations": {
"production": {
...
"fileReplacements": [
{
"replace": "apps/some-app/src/environments/environment.ts",
"with": "apps/some-app/src/environments/environment.prod.ts"
}
],
},
"development": {
...
}
},
"defaultConfiguration": "production"
},