0

When I change the environments configuration in angular.json,

"customer1-dev": {
            "fileReplacements": [
                {
                    "replace": "src/environments/environment.ts",
                    "with": "src/environments/environment.customer1.ts"
                }
            ],
            "buildOptimizer": false,
            "optimization": false,
            "vendorChunk": true,
            "extractLicenses": false,
            "sourceMap": true,
            "namedChunks": true
            
        },

When I add 'fileReplacements' in the configuration, my app run very slow.

and when I remove the 'fileReplacements' then app run faster.

I had create a environment setup for the different-2 customer with the same app source-code. Reference URL That's why I need to setup configuration in angular.json.

Environment setup for customer specific, is working fine but app run very slow.

1
  • can you include all of the configurations inside angular.json? if you're trying to run production settings e.g. optimization: true during development it will be slow. A development config may be helpful Commented Jan 23, 2024 at 8:13

1 Answer 1

0

Typical development config:

{
    "configurations": {
        ...
        // can change "development" to any configuration target
        "development": {
          "buildOptimizer": false,
          "optimization": false,
          "vendorChunk": true,
          "extractLicenses": false,
          "sourceMap": true,
          "namedChunks": true,
          "fileReplacements": [...]
        }
}

By not optimising the dev server is faster. Obviously you'll need a separate production config to get an optimised build.

Sign up to request clarification or add additional context in comments.

2 Comments

Yes, I also try this but still run very slow.
Yeah, just saw update to your post. Not sure. As far as I know fileReplacements runs only once so the app being slow doesn't make sense

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.