Skip to content

Speed up vite-plugin-solid with vite hook filters #259

Open

Description

@ChristophP

During our vite build a significant amount of time (60+%) is spent in vite plugin solid.

Image

Since rolldown vite plugins can be sped up significantly with hook filters to allow for fewer Rust to JS calls.
https://rolldown.rs/apis/plugin-api/hook-filters

By turning this:

export default function myPlugin() {
  return {
    name: 'example',
    transform(code, id) {
      if (!id.endsWith('.data')) {
        // early return
        return
      }
      // perform actual transform
      return transformedCode
    },
  }
}

into this

export default function myPlugin() {
  return {
    name: 'example',
    transform: {
      filter: {
        id: /\.data$/
      },
      handler(code) {
        // perform actual transform
        return transformedCode
      },
    }
  }
}

Backward compatibility

The syntax has supported since vite 6.3+ and could be made backward compatible by leaving the checks in the handlers.

Implementation

Would you be interested in a PR for this change?

Activity

  1. brenelz commented on Jul 16, 2026

    @brenelz
    Contributor

    Yeah I think we'd be open to a PR around this

  2. ChristophP commented on Sep 1, 2026

    @ChristophP
    Author

    @brenelz I provided an implementation in #337 . Let me know if anything needs fixing. There is backward compatibilty, so this should be good for a minor/patch release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions