Replies: 2 comments
-
The short answer is no. What Vue does seems to rely on tighter runtime integration, but React doesn't have such opinionated mechanism yet. So if you want to imitate that, then you'll probably need to build on your own (though I'm guessing it wouldn't be possible for react either way since Vue plugin probably also relies on SFC (single file component) giving easier matching between "render" and "module"). Btw, I'm not sure if that's actually the right question to ask considering your use cases:
If you're using Also, regarding lazy component styling, this issue might be prevalent in Vite SSR framework in general (I remembered the one discussed on solid start solidjs/solid-start#1458 (comment) and I expect Remix also does FOUC for lazy component since they only crawl Since you are only concerned with your own ssr app, I think the solution would be to process |
Beta Was this translation helpful? Give feedback.
-
@hi-ogawa I added a plugin to obtain module dependencies |
Beta Was this translation helpful? Give feedback.
-
when using lazy loading with react-router, multiple js/css files are expected; however, server-side rendering only returns two files.
There should be multiple files(index-xxx.js/index-xxx.css/create-xxxx.js/create-xxxx.css) for the path home(page create), but the server-side rendering only returned 2 files((index-xxx.js/index-xxx.css). The complete set of files appeared only after hydration, leading to a flickering effect in the page styles.
server side:
client side:
The manifest(dist\client.vite\ssr-manifest.json) contains mappings of module IDs to their associated chunks and asset files.
I did't find context.modules for vite react ssr. The @vitejs/plugin-vue supports it for vue. What about the @vitejs/plugin-react?
server with Express.js:
Is there a vite plugin which supports context.modules for react SSR ?
Beta Was this translation helpful? Give feedback.
All reactions