-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Closed
Description
Let's say I put an image in /static/img.png and then reference it somewhere in css like so
.wrapper {
background: url('/static/img.png')
}
It works fine. But when deployed to non-first-level url the app is referencing assets from root.
Thus, if I were to deploy to https://example.com/app-name/, the app would be referencing https://example.com/static/img.png instead of https://example.com/app-name/static/img.png (with /app-name).
If I don't go from root in CSS background: url('static/img.png') (fronting slash removed) webpack will interpret it as a module dependency.
How do I solve this?
*vue-cli webpack 2 template
Metadata
Metadata
Assignees
Labels
No labels