Vite · Plugins
VITE0014Filter broad Vite plugin transforms
Finds Vite plugin code that should use the supported transform filter pattern instead.
vite-doctor/vitepluginsinfoNo fix
Why it happens
A hook filter lets Vite and Rolldown skip invoking transform() for unrelated modules instead of paying for a userland check on every file.
Fix
Use the Vite-supported transform filter pattern instead.
Example
Filter plugin transforms
Before
export default function markdownPlugin() {
return {
name: 'markdown',
transform(code, id) {
if (!id.endsWith('.md')) return
return code
},
}
}
After
export default function markdownPlugin() {
return {
name: 'markdown',
transform: {
filter: { id: /\.md$/ },
handler(code) { return code },
},
}
}
Verify the fix
Run only this rule after editing so the report stays focused on the diagnostic you are closing:
pnpm vite-doctor . --framework vite --extends auto,vite/strict --rules vite/plugin/prefer-transform-filter