Skip to content

Add hook filter rules to vite, rollup and unplugin plugins #171

@TheAlexLichter

Description

@TheAlexLichter

With Rolldown being used more and more, Vite and Rollup plugins can be more performant (build speed) by defining hook filters for their used hooks. This will reduce the overhead for communication between the JavaScript and Rust runtimes.

Hook filters are supported in Vite 6.3.0+ and Rollup 4.38.0+, as well as in unplugin.

As the hook filters come at "no cost" and applying them is often straightforward, given that some kind of filter is happening in the hook functions, which has to be ported out of the function to the filter object, I thought it could be a great umbrella issue for e18e.

When migrating to hook filters, plugin authors can decide to stay backwards-compatible by leaving the conditional check in the respective hook and add the filter "on top", if necessary.

Example PRs:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions