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
Why do output plugins run before input plugins? #3845
Comments
Is there a reason why they should run last? |
I'm creating an output plugin with some context that only exists after I also think it's less surprising to run output plugins last, since they are added after input plugins. |
I reworked the feature in Vite so I can add an input plugin, but I still think output plugins should run last. Not sure it's worth the breaking change or not, though. |
This both definitely confusing (undocumented) and definitely a problem (intuitive and possibly disruptive)! I am generating two output bundles (a
Its taken me half a day to diagnose why something as simple is not working and then to find this comment |
This issue has been resolved via #3846 as part of rollup@3.0.0-5. Note that this is a pre-release, so to test it, you need to install Rollup via |
This issue has been resolved via #3846 as part of rollup@3.0.0-6. Note that this is a pre-release, so to test it, you need to install Rollup via |
This issue has been resolved via #3846 as part of rollup@3.0.0-7. Note that this is a pre-release, so to test it, you need to install Rollup via |
This issue has been resolved via #3846 as part of rollup@3.0.0-8. Note that this is a pre-release, so to test it, you need to install Rollup via |
This issue has been resolved via #3846 as part of rollup@3.0.0. You can test it via |
Documentation Is:
Please Explain in Detail...
If both an input plugin and output plugin have a
generateBundle
hook, the output plugin's hook runs first.Is there a reason for this?
Your Proposal for Changes
Run output plugins last (if possible?).
Or provide a method on
PluginContext
that allows a hook to postpone itself until other hooks for the same phase have finished, like this:The text was updated successfully, but these errors were encountered: