Versions
Angular CLI: 6.0.0
Node: 8.11.1
Angular: 6.0.0
Windows 7
Repro steps
Reproduce git: https://github.com/idododu/ng6-filereplacements-bug
- Step 1: add
fileReplacements config in configurations block of angular.json
"project-b": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.project-b.ts"
},
{
"replace": "src/app/home-a/home-a.component.html",
"with": "src/app/home-b/home-b.component.html"
},
{
"replace": "src/app/home-a/home-a.component.ts",
"with": "src/app/home-b/home-b.component.ts"
}
]
}
- Step 2:
npm run project-b to start dev server
Observed behavior
home-a.component.ts was replaced correctly.
home-a.component.ts in chrome source

home-a.component.ts in my source code

home-a.component.ts was not replaced
home-a.component.html in chrome source
module.exports = "<p>\r\n home-a works!\r\n</p>\r\n"
home-a.component.html in my source code
home-b.component.html in my source code
Desired behavior
- Expected to see
content of home-a.component.html should be replaced by home-b.component.html since i have configed in angular.json
{
"replace": "src/app/home-a/home-a.component.html",
"with": "src/app/home-b/home-b.component.html"
},
- Usecase
Suppose we got two projects: Project A and Project B.
They share the most of my source codes except HomeComponent.
And I would like to put the codes in the same repo, and build different projects through environments configuration.
Mention any other details that might be useful (optional)
Another point: can we support glob expressions in fileReplacements configuration?
{
"replace": "src/app/home-a/*/**",
"with": "src/app/home-b/*/**"
}
Versions
Repro steps
Reproduce git: https://github.com/idododu/ng6-filereplacements-bug
fileReplacementsconfig inconfigurationsblock ofangular.jsonnpm run project-bto start dev serverObserved behavior
home-a.component.tswas replaced correctly.home-a.component.tsin chrome sourcehome-a.component.tsin my source codehome-a.component.tswas not replacedhome-a.component.htmlin chrome sourcehome-a.component.htmlin my source codehome-b.component.htmlin my source codeDesired behavior
content of
home-a.component.htmlshould be replaced byhome-b.component.htmlsince i have configed inangular.jsonSuppose we got two projects: Project A and Project B.
They share the most of my source codes except HomeComponent.
And I would like to put the codes in the same repo, and build different projects through
environmentsconfiguration.Mention any other details that might be useful (optional)
Another point: can we support glob expressions in fileReplacements configuration?