Initially, I wrote udk:udk-builder to accept fileReplacements because the Angular CLI wasn't support them.
It's not the case today.
Now you can move your fileReplacements declarations into server target. Be careful to use the latest syntax of Angular CLI:
"server": {
"builder": "@angular-devkit/build-angular:server",
"options": {
"outputPath": "dist/server",
"main": "src/app/ngmodule.ts",
"tsConfig": "src/tsconfig.server.json"
},
"configurations": {
"production": {
+ "fileReplacements": [
+ {
+ "replace": "src/environments/environment.ts",
+ "with": "src/environments/environment.prod.ts"
+ }
+ ]
}
}
}
Initially, I wrote
udk:udk-builderto acceptfileReplacementsbecause the Angular CLI wasn't support them.It's not the case today.
Now you can move your
fileReplacementsdeclarations intoservertarget. Be careful to use the latest syntax of Angular CLI:"server": { "builder": "@angular-devkit/build-angular:server", "options": { "outputPath": "dist/server", "main": "src/app/ngmodule.ts", "tsConfig": "src/tsconfig.server.json" }, "configurations": { "production": { + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + } + ] } } }