Angular CLI fileReplacements for default/development
I assume with "default/development configuration" you are referring to what is served with the ng serve
command.
Option 1: replace environment files:
You can specify the fileReplacements
array in the build
object as well (this one is used for ng serve
).
"build": {
"options": {
[...]
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.development.ts"
}
]
},
"configurations": {
// other - non default - configurations
}
}
Option 2: specifiy default configuration:
If you want to serve an already existing configuration withng serve
, you can change the serve
options:
"configurations": {
"youConfigName": {
// config details here
}
},
[...]
"serve": {
"options": {
"browserTarget": "name-of-your-app:build:youConfigName"
}
}
The important point is to set the build configuration target with :yourConfigName
.
Both options are configured per project and therefore allow you full control.