-
Notifications
You must be signed in to change notification settings - Fork 12k
Assets not correctly adjusting with deploy-url parameter on the build #9835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It seems to be the same as #6666 (just discovered) |
Got hit by this as well. Cliff's notes: |
A browser only applies the base href to relative assets. The Note also that based on the HTML spec., the base HREF value should end with a |
In some cases you need to host the app itself in one place (a sub-directory or an MVC area in my case) but the assets are elsewhere (like CDN). In these cases both baseHref and deployUrl options have to be provided, and just like OP said |
If you are referring to the need to set the routing root for the application, then you can do that with the Documentation for the token can be found here: https://angular.io/api/common/APP_BASE_HREF |
This issue is the same as #6666. Please follow that issue for updates. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Versions
Repro steps
ng new example
and install the dependenciesnpm install
.cp sample.png src/assets
and modify app.components.html adding the image:ng build --deploy-url=/y --base-href=/y -op=/tmp/y
http-server -p 4200 /tmp
)Repo with the code for easier reproduction: https://github.com/ignaciolarranaga/9835-issue
Observed behavior
The img src is not prepended with /y as expected (or the folder you want to):

Desired behavior
The image src to be prepended with the /y:
The text was updated successfully, but these errors were encountered: