hi I m trying to make u…

1 minute read

hi! I’m trying to make use of fileReplacements in my production configuration (it’s an angular app). I’m adding this { "replace": "apps/frontend/src/configurations/config.json", "with": "apps/frontend/src/configurations/config.prod.json" } in projects.frontend.architect.build.configurations.production.fileReplacements I also have "apps/frontend/src/configurations/config.json", added to projects.frontend.architect.build.options.assets . I expect to get the content of config.prod.json replaced into config.json in my dist/apps/frontend folder after I build the app

Well, this is not happening. Any ideas why this configuration does not work with assets?

Responses:

Sorry if this could be an obvious question… but are you sure you’re building in production configuration? e.g. –prod

yup. –prod

ok, check if “fileReplacements”: [] is an array

yeah, it is. i’m trying right now to test it on a new project because my repo is quite big now

so I tried using a fresh project with just an angular app and it doesn’t work either :disappointed:

weird :disappointed: don’t know…

found it https://github.com/angular/angular-cli/issues/16779 i’ll have to see how i fix this :sweat:

Weird, I used it yesterday. Which versions are you using?

ng 9

Which exact versions of Angular, Angular CLI and Node.js? Run ng version

```> npm run ng – version

> simplifi@0.0.0 ng C:\Users\apolo\projects\cloudx\simplifi\simplifi > ng “version”

 _                      _                 ____ _     ___
/ \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|    / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |   / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |  /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
            |___/

Angular CLI: 9.1.0 Node: 12.6.0 OS: win32 x64

Angular: 9.1.0 … animations, cli, common, compiler, compiler-cli, core, forms … language-service, platform-browser, platform-browser-dynamic … router Ivy Workspace: Yes

Package Version

@angular-devkit/architect 0.901.0 @angular-devkit/build-angular 0.901.0 @angular-devkit/build-optimizer 0.901.0 @angular-devkit/build-webpack 0.901.0 @angular-devkit/core 9.1.0 @angular-devkit/schematics 9.1.0 @angular/cdk 9.2.0 @angular/flex-layout 9.0.0-beta.29 @angular/material 9.2.0 @ngtools/webpack 9.1.0 @schematics/angular 9.1.0 @schematics/update 0.901.0 rxjs 6.5.4 typescript 3.8.3 webpack 4.42.0```

Updated: