Replies: 2 comments 1 reply
-
Did you ever find an answer to this? I have the same situation going on |
Beta Was this translation helpful? Give feedback.
0 replies
-
Does this experimental option help? https://main.vitejs.dev/guide/build.html#advanced-base-options From #8450 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
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