Nx: library does not have fileReplacements options

Created on 12 May 2020  路  1Comment  路  Source: nrwl/nx

I am splitting my application into two different services. This requires me to factor out the data access code in a separate library. Unfortunately, I do not see a fileReplacement option in workspace.json for the library.

I need to have different settings likes query logging on or off, caching in memory or Redis, and discovery services based on the environment. I was hoping that I will configure various env settings under libs/data/src/environments and switch to appropriate env during the build.

Can someone help me how to achieve this?

misc question / discussion

Most helpful comment

Unfortunately, the fileReplacement has to be done in the app config. But you can pass files from the lib there as follows:


                {
                  "replace": "libs/environment/src/environments/environment.ts",
                  "with": "libs/environment/src/environments/environment.prod.ts"
                }

>All comments

Unfortunately, the fileReplacement has to be done in the app config. But you can pass files from the lib there as follows:


                {
                  "replace": "libs/environment/src/environments/environment.ts",
                  "with": "libs/environment/src/environments/environment.prod.ts"
                }
Was this page helpful?
0 / 5 - 0 ratings

Related issues

about-code picture about-code  路  3Comments

IonFoXx picture IonFoXx  路  3Comments

vimalraj-a picture vimalraj-a  路  3Comments

jasedwards picture jasedwards  路  3Comments

MichaelWarneke picture MichaelWarneke  路  3Comments