angular / angular-cli

CLI tool for Angular
https://cli.angular.dev
MIT License
26.78k stars 11.98k forks source link

file paths inside index.html do not support custom output paths #16131

Open chrisguttandin opened 5 years ago

chrisguttandin commented 5 years ago

🐞 Bug report

Command

- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

I don't know for sure, but I don't think so.

Description

The CLI currently allows to modify the output path of the index.html file. This works fine. Unfortunately it only modifies the output path and doesn't modify the file paths which are used inside the index.html file to reference the JavaScript files.

🔬 Minimal Reproduction

"index": {
    "input": "src/index.html",
    "output": "subdirectory/index.html"
}

🔥 Exception or Error

It doesn't throw an error.

🌍 Your Environment


Angular CLI: 8.3.18
Node: 12.13.0
OS: darwin x64
Angular: 8.2.13
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.803.18
@angular-devkit/build-angular     0.803.18
@angular-devkit/build-optimizer   0.803.18
@angular-devkit/build-webpack     0.803.18
@angular-devkit/core              8.3.18
@angular-devkit/schematics        8.3.18
@angular/cli                      8.3.18
@ngtools/webpack                  8.3.18
@schematics/angular               8.3.18
@schematics/update                0.803.18
rxjs                              6.4.0
typescript                        3.5.3
webpack                           4.39.2

Anything else relevant?

I'm happy to provide a pull request for this if you agree that this is a bug.

clydin commented 5 years ago

The main intentional of that option is to allow the renaming the index file and support of custom build and staging setups. These generally have a variety of additional options in use as well as custom pre/post processing steps. Modifying the content could cause such setups to fail. There is the potential to add an extra option that supports your scenario however the amount of usage may not warrant the long term cost of an additional option. Added the issue to the team discussion list.

chrisguttandin commented 5 years ago

Thanks for the quick response @clydin.

Sorry, I didn't know that this was intended to only rename the file.

In case we would resolve the paths of all Githubissues.

  • Githubissues is a development platform for aggregating issues.