Trying to get angular-cli to recognise multiple configurations in angular.json
C:\_devmyapp>ng serve --configuration development
Configuration 'development' could not be found in project 'myapp'.
Error: Configuration 'development' could not be found in project 'myapp'.
The snippet being:
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.production.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true
},
"development": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.development.ts"
}
],
"optimization": false,
"outputHashing": "all",
"sourceMap": true,
"extractCss": true,
"namedChunks": true,
"aot": false,
"extractLicenses": false,
"vendorChunk": true,
"buildOptimizer": false
}
}
src/environments/environment.development.ts
does exist
ng serve --configuration production
works fine
question from:
https://stackoverflow.com/questions/50477062/angular-6-multiple-configurations-twas-environments 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…