-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Backend integration guide: preloading dynamic entry points? #16598
Comments
This documentation was expanded recently #16086 and probably what's intended there was multi entry point (pages) scenarios like: rollupOptions: {
input: ['main.js', 'views/foo.js', ...],
} So, you put What looks confusing is that Technically this situation might be possible if "main" page dynamically loads "foo" page on client side like SPA, but explaining all this might be beyond the simple doc. |
But using e.g. The example doesn't show the configuration that was used, so one would have to assume e.g. And one would not (I assume?) actually render tags for a dynamic entry on a page? Rendering tags would always start from an Still trying to understand if my library should throw an exception if you attempt to create tags for a chunk that is not an entry point. 😵💫 |
It was in an inconsistent state. I made a PR to fix that: #16620
There aren't any cases unless that chunk is also a entry. For example, in this repro (https://stackblitz.com/edit/vitejs-vite-nfbzrw?file=vite.config.js&terminal=dev)
Yes. That's correct. |
@sapphi-red thank You for the clarification. 🙂 I think that settles the issue, so I will close this. @hi-ogawa thank you as well 🙂 |
Documentation is
Explain in Detail
Following the backend integration guide, I've written a Composer package for vanilla PHP integration, and I hope you can clarify something from the example in the documentation here.
My question is regarding the example near the end of the page:
vite/docs/guide/backend-integration.md
Lines 135 to 142 in 6a7dde5
The example
manifest.json
on this page showsviews/foo.js
being a dynamic entry:vite/docs/guide/backend-integration.md
Lines 74 to 79 in 6a7dde5
My question is, when or why would you be preloading a dynamic entry?
To the best of my understanding, a dynamic is loaded dynamically - which, as I understand it, would mean you're not emitting tags on a page, but rather loading the script with an
await import
statement somewhere in the main script?Is there any real world use case for an entry with
isDynamicEntry
to be (pre) loaded on a page?If this is an error, I might prefer for my package to throw an exception for this case.
Your Suggestion for Changes
The page may need some clarification per my question above. Not sure. 🙂
Reproduction
No response
Steps to reproduce
No response
The text was updated successfully, but these errors were encountered: