best way to handle subdomains and assets #2906
Unanswered
russellsamora
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've encountered this specifically with adapter static, but I believe this is part of core kit.
When I try build on a subdomain (e.g., github pages), just modifying
paths { base: "subdomain" }
works in animg
tag src whether dev or deployed. But if you set the asset via the style tag, like usingbackground: url("thing.png")
it works in dev but not deployed.I'd expect it to work the same in both places, but maybe that is the wrong framing. My current hack is to just use
import { base } from "$app/paths";
and pass that through as a css var like<div style="--base: {base}">
. I haven't tried modifyingpath.assets
in config but according to the doc that requires an absolute url, which would make it less portable.Any thoughts?
Beta Was this translation helpful? Give feedback.
All reactions