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
Module execution order can be incorrect when having multiple entrypoints #5423
Comments
Yes, I am aware of this and it is indeed a duplicate. One problem is that fixing this would involve creating quite a few more chunks, and we already have a lot of chunks in complicated projects. So I wonder if this "strict execution order" should be an opt-in or an opt-out for users via an option. What would you think? |
In Vite, we transform each HTML into a module with I guess in most cases, users would want to apply it only to some modules like modules injecting polyfills. |
For polyfills, there is usually not a problem if you ensure that all static entries first import the polyfill. See also https://rollupjs.org/faqs/#how-do-i-add-polyfills-to-a-rollup-bundle . But it would still be nice to fix this properly. |
Ah, that's true. If rollup goes with the latter way (= track which modules have side effects), Vite would need to inject a dummy statement that has side effects and remove that later in Maybe starting with an new option that opt-in the behavior is good. Then, I guess we can know how much the number of chunks will increase. Also we can try if |
Setting |
Rollup Version
4.12.1
Operating System (or Browser)
StackBlitz / REPL
Node Version (if applicable)
No response
Link To Reproduction
Expected Behaviour
Actual Behaviour
Additional Information
Maybe this is a duplicate of #3888. I made a different issue as this might be easier to fix than the repro in #3888. Feel free to close this one if it's better to be merged in to #3888.
The text was updated successfully, but these errors were encountered: