ng build --prod --base-href includes absolute path of building cwd
See original GitHub issueBug Report or Feature Request (mark with an x
)
- [x] bug report -> please search issues before submitting
- [ ] feature request
Command (mark with an x
)
- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Versions
Windows 10, GIt Bash
$ ng --version
Angular CLI: 6.2.3
Node: 8.12.0
OS: win32 x64
Angular: 6.1.8
Repro steps
Build project by the following command:
ng build --prod --base-href /client1-app
The log given by the failure
n/a
Desired functionality
Application need to be deployed under http://example.com/client1-app. The base path for it should be /client1-app
then.
However in index.html wrong base path is included:
$ grep base dist/election-barometer/index.html
<base href="E:/Programs/Git/client1-app">
The git installation path (absolute path of installation dir) is included when --base-href
starts with slash character.
Base href cannot be just client1-app
(without slash at the beggining), because of routing. User can start application from:
/client1-app/some/path/started
Then, client1-app
will point to example.com/some/path/client1-app
Which is not intended, so slash at the beggining is required.
Mention any other details that might be useful
The following repository could be useful during investigation: https://github.com/athlan/election-barometer However, nothing special on it, was generated by ng cli.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:6 (2 by maintainers)
Noticed this as well, but only happened when using bash. Seems to work as expected in PowerShell.
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.