v4.2.1
Remove generic parameter on Plugin
to avoid type error with Rollup 4/Vite 5 and skipLibCheck: false
.
I expect very few people to currently use this feature, but if you are extending the React plugin via api
object, you can get back the typing of the hook by importing ViteReactPluginApi
:
import type { Plugin } from 'vite'
import type { ViteReactPluginApi } from '@vitejs/plugin-react'
export const somePlugin: Plugin = {
name: 'some-plugin',
api: {
reactBabel: (babelConfig) => {
babelConfig.plugins.push('some-babel-plugin')
},
} satisfies ViteReactPluginApi,
}