-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generating preload directives or changing bundle included in rendered HTML #80
Comments
Indeed, that is a question I have myself now — and is currently unanswered. With Vue, running
The bundle comes from the Vite automatically transforms that, both in development and production modes. ⁂ As for code-splitting, it's already possible. The Let's keep this issue open to track this. |
Thanks for the reply @galvez - and great to get the conversation started.
yeah me neither - its a complete mystery to me still. However - I wonder if we do codesplit across routes using
Yup - but I wonder if we have more control over this? For example - when I go to /mystaticpage, and this page is completely prerendered (i.e. no need for js) - would I be able to disable hydration and remove the JS bundles all together? |
This is exactly how Vite behaves as well.
Yes, I'm actually almost done with an example demonstrating just that! |
Prerequisites
🚀 Feature Proposal
Let's say we have an example app with the following routes:
/ -> HomePage
/about -> AboutPage
And assume in the project, I've implemented code splitting (using
await import
) - to make sure AboutPage and HomePage bundles are separate.And finally, along the same lines:
Motivation
Being able to only load the bundles required for the page being rendered.
I can currently see config values exposed for customising the template, but nothing for customising the bundle that gets added to the HTML.
Things I am unable to see a clear picture (as a Vite newbie):
Example
There is an example on the Vite SSR docs: https://vitejs.dev/guide/ssr.html#generating-preload-directives (with some broken links) - where they suggest that the vite-vue plugin contains support for collecting moduleIds on render - no equivalent for React.
The text was updated successfully, but these errors were encountered: