Vue SSR: make initial chunks dependent on a current route? #5798
Replies: 1 comment
-
I've got an answer myself. I think it has nothing to do with RsPack and RsBuild, and everything to do with Vue 3. Vue 2 server renderer was generating a special manifest which enabled required behaviour. |
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
Uh oh!
There was an error while loading. Please reload this page.
-
I'm migrating my site from Vue 2 + Webpack to Vue 3 + RsBuild, SSR included.
So far I've completed almost everything, RsBuild works great and very fast.
Yet I have a problem and what seems as a deep misunderstanding of one thing about RsBuild. I would very appreciate if someone could clarify that for me.
In the previous setup with Webpack and Vue 2 official server renderer, rendering process "automatically" respected current request URL and provided assets (JS, CSS) URLs to be included in HTML specifically for this request. For example, files for the current page main component (the one that is set in Vue Router configuration) and anything included from there.
In the new setup with RsBuild, I always get the same asset URLs from the manifest. Current page doesn't play any role because I get these URLs even before rendering itself, the manifest is static and simple.
The files in
initial
field of manifest are the few ones which are always required for the whole app.The files in
async
are literally all the other files.Is it possible to achieve the previous behavior? I don't understand how it can be done with RsBuild.
That causes a serious downgrade for my app.
As big portion of JS/CSS required for any page is always loaded a bit later asynchronously by a call from JS instead of being linked right in HTML, all pages experience a pretty nasty FOUC.
Beta Was this translation helpful? Give feedback.
All reactions