Replies: 1 comment
-
Did you ever find an answer to this? I have the same situation going on |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
A bit of context, I'm porting a large app built with webpack to vite, my app is setup so each builds are agnostics and can be used on dev/staging/production and my backend is providing the base html file while injecting some environment variables.
The assets generated at build are on a different domain that my actual app, https://assets.foo.com while my app is on https://foo.com.
My issue is that the path of the images are all starting with
/
, but I'd like them to usehttps://assets.foo.com/
instead, in webpack I could set__webpack_public_path__
which did the trick but I can't find a way to do it with vite.Here's what I've tried:
<base href="https://assets.foo.com" />
won't because it'll change all my relative path, including links to different pagesbase
is not possible since my build have to be agnosticsI could wrap my images in a function that add prefix them with my environment variable but I'm really not keen on having to do that.
Do you have any other ways to solve my problem ?
Beta Was this translation helpful? Give feedback.
All reactions