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
feat: support nested plugin #4657
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! See my comment. We would also need some documentation for this, though. You should update the types and mention array support in the plugins
and output.plugins
sections of the 999-big-list-of-options.md
.
One last thing to consider is that ideally, the --configPlugin
option should support arrays as well. Which means we should probably replace
rollup/cli/run/commandPlugins.ts
Line 25 in 250c2b2
const plugins = Array.isArray(commandPlugin) ? commandPlugin : [commandPlugin]; |
const plugins = ensureArray(commandPlugin).flat(Infinity).filter(Boolean);
as well.
Codecov Report
@@ Coverage Diff @@
## master #4657 +/- ##
=======================================
Coverage 99.06% 99.06%
=======================================
Files 214 214
Lines 7558 7558
Branches 2098 2097 -1
=======================================
Hits 7487 7487
Misses 23 23
Partials 48 48
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
Thanks for your guidance. I was very impressed with your presentation at ViteConf! |
@lukastaegert Coverage seems to have failed. I just removed |
This PR has been released as part of rollup@3.1.0. You can test it via |
No worries. At some point I guess we should add the missing test, but this was indeed unrelated to your PR. |
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Description
Support nested plugin
Since Vite supported this feature already. I think Rollup should have it too.
Consider the case:
When using object hooks, there's no way to put order both
pre
andpost
in the one plugin ATM.After this PR: