Ubuntu
1.0.0-beta.17
My angular2 application, built with ng build --prod, is mounted to https://domain/app.
The problem is that scripts and styles injected in index.html have paths like src="styles.8e0edbbd6ad2cb36be49.bundle.js", so page is trying to look for them in root.
How to change it to src="./styles.8e0edbbd6ad2cb36be49.bundle.js"?
Thank you.
You can use 'ng build --prod --base-href /app/ ' to set the base href in the index.html to your directory.
In the <head> section of your index.html add the line:
<base href="/<base-folder>/">
That worked for me
--base-href parameter helped, thank you.
I'm using Angular 6, and setting --base-href wasn't enough to solve this, but setting deployUrl in angular.json did.
You can set it in projects -> $projectName -> architect -> build -> options.
E.g.
"deployUrl": "/app/"
Huge Thum
I'm using Angular 6, and setting
--base-hrefwasn't enough to solve this, but settingdeployUrlinangular.jsondid.You can set it in
projects -> $projectName -> architect -> build -> options.E.g.
"deployUrl": "/app/"
Two thumbs way up! I spent the whole day trying to figure this out and I stumbled across your solution and it works great! Thank you very much for your assistance!
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._
Most helpful comment
You can use 'ng build --prod --base-href /app/ ' to set the base href in the index.html to your directory.