-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
This came up on X where someone compared the load times: https://x.com/TheAlexLichter/status/1930977073931206928
The problem hook filters solve is getting rid of the JS-to-Rust overhead by only invoking a plugin call when it's necessary. For example in this case, we can add a hook filter, that only considers files which include .data
:
transform(code, id) {
if (!id.endsWith('.data')) { }
}
With a filter, this looks like this:
transform: {
filter: {
id: /\.data$/
},
handler (code) { /* the actual transform handler code */ }
The feature is also supported by Rollup 4.38.0+ and Vite 6.3.0+.
Metadata
Metadata
Assignees
Labels
No labels