Closed
Description
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 inconfigurations
block ofangular.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
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
<p>
home-a works!
</p>
home-b.component.html
in my source code
<p>
home-b works!
</p>
Desired behavior
- Expected to see
content ofhome-a.component.html
should be replaced byhome-b.component.html
since i have configed inangular.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 throughenvironments
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/*/**"
}
Metadata
Metadata
Assignees
Labels
No labels