ivi icon indicating copy to clipboard operation
ivi copied to clipboard

Plugin Hook Filters for Vite Plugin

Open TheAlexLichter opened this issue 3 months ago • 1 comments

Hey 👋

Glad to see the support for Rolldown and Vite. I've noticed that the Vite plugin transform hook has no hook filter (unlike the Rolldown plugin). Adding it would improve performance with rolldown-vite (and the next Vite major version).

They are backwards-compatible (leave the function check in for full bw compat and older Vite versions if needed), and also available in Rollup!

See also:

  • https://vite.dev/guide/rolldown.html#hook-filter-feature
  • https://github.com/e18e/ecosystem-issues/issues/171

PS: If you consider unifying the plugin architecture, you might want to take a look at https://github.com/unjs/unplugin

TheAlexLichter avatar Oct 26 '25 17:10 TheAlexLichter

Hi, thanks for the tip.

If you consider unifying the plugin architecture, you might want to take a look at https://github.com/unjs/unplugin

Unfortunately, ivi compiler has a "whole program optimization" pass that depends on the renderChunk hook that isn't available in the unplugin library. And as I understand, bundlers like esbuild, bun, etc doesn't provide any hooks with a similar behavior.

localvoid avatar Oct 27 '25 06:10 localvoid