During our vite build a significant amount of time (44%) 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?
During our vite build a significant amount of time (44%) 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:
into this
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?