solidjs / solidjs/solid-vite-plugin
Speed up vite-plugin-solid with vite hook filters
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 520
- Forks
- 70
- Avg merge
- 23h 35m
- Merged PRs (30d)
- 39
Description
During our vite build a significant amount of time (60+%) is spent in vite plugin solid.
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?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue does not name a file or test; locate the Vite plugin transform hooks in the solid-vite-plugin source and compare their current id checks with the hook-filter API linked in the report. Preserve backward compatibility as described, then verify the plugin's Vite build behavior and the reported transform performance improvement.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- build-system, tooling
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100