Skip to content

Angular.json File replacement not working for index.html file #10992

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
ghost opened this issue May 24, 2018 · 3 comments
Closed
1 task done

Angular.json File replacement not working for index.html file #10992

ghost opened this issue May 24, 2018 · 3 comments

Comments

@ghost
Copy link

ghost commented May 24, 2018

I'm submitting a...


[X] Bug report  

Current behavior

In angular.json build.configuration.fileReplacement does not replace index.html with index.prod.html

Expected behavior

Should replace index.html with index.prod.html similar to how it replaces environment.ts with environment.prod.ts

Minimal reproduction of the problem with instructions

1. Create a new index.prod.html in same directory as original.
2. Update angular.json to replace the original index.html with the new index.prod.html

"configurations": {
                        "production": {
                            "optimization": true,
                            "outputHashing": "all",
                            "sourceMap": false,
                            "extractCss": true,
                            "namedChunks": false,
                            "aot": true,
                            "extractLicenses": true,
                            "vendorChunk": false,
                            "buildOptimizer": true,
                            "fileReplacements": [
                                {
                                    "replace": "src/environments/environment.ts",
                                    "with": "src/environments/environment.prod.ts"
                                },
                                {
                                    "replace": "src/index.html",
                                    "with": "src/index.prod.html"
                                }
                            ]
                        },

What is the motivation / use case for changing the behavior?

Environment

Angular CLI: 6.0.0
Node: 9.8.0
OS: darwin x64
Angular: 6.0.0
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, http, language-service, material, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.0
@angular-devkit/build-angular     0.6.0
@angular-devkit/build-optimizer   0.6.0
@angular-devkit/core              0.6.0
@angular-devkit/schematics        0.6.0 (cli-only)
@angular/flex-layout              6.0.0-beta.15
@ngtools/webpack                  6.0.0
@schematics/angular               0.6.0 (cli-only)
@schematics/update                0.6.0
rxjs                              6.1.0
typescript                        2.7.2
webpack                           4.6.0

Browser:

  • Chrome (desktop) version XX

For Tooling issues:

  • Node version: v9.8.0
  • Platform: Mac

Others:

@ghost
Copy link

ghost commented May 25, 2018

Seems it's a duplicate of #10881.
Issue is already fixed and is waiting for 6.1 release (I hope so, from comments to issue above).

@filipesilva
Copy link
Contributor

Closing as duplicate of #10881, thanks @pbazurin-softheme 👍

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant