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
environments
directory -
Create your custom environments
environment.ts
environment.prod.ts
environment.staging.ts
etc.
-
Update your
angular.json
orproject.json
to dofileReplacements
where the paths are from project root to the environment file forreplace
andwith
:
"configurations": {
"production": {
...
"fileReplacements": [
{
"replace": "apps/some-app/src/environments/environment.ts",
"with": "apps/some-app/src/environments/environment.prod.ts"
}
],
},
"development": {
...
}
},
"defaultConfiguration": "production"
},