asset server url #26
wmertens
started this conversation in
Proposals For Qwik
Replies: 0 comments
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.
-
What is it about?
being able
What's the motivation for this proposal?
Problem
So when hosting an app, you have these things to host:
So, Qwik needs to know about two servers : the app server and the asset server. The media files should be handled by custom components and Qwik has no role there.
However, since assets URLs are also provided by vite, it will need configuring at the vite level.
Proposed Solution / Feature
What do you propose?
Vite has an experimental feature https://vite.dev/guide/build.html#advanced-base-options that allows you to change an asset URL at runtime.
Qwik-city could use this to provide an asset server, to be filled in from a
q:assetsparameter on the container.In
vite.config.mts:this makes it configure vite to change the asset urls.
We could make it dynamic on top of that, by passing arguments to
createQwikCitywhich would result in a prop on the container that would be used dynamically via some sort of global function.Links / References
https://vite.dev/guide/build.html#advanced-base-options
Beta Was this translation helpful? Give feedback.
All reactions