Skip to content

Commit

Permalink
feat(plugin-react): pre-optimize jsx-dev-runtime (vitejs#5036)
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 authored and aleclarson committed Nov 8, 2021
1 parent 9e8ca92 commit ca142b4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/plugin-react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,13 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
const viteReactJsx: Plugin = {
name: 'vite:react-jsx',
enforce: 'pre',
config() {
return {
optimizeDeps: {
include: ['react/jsx-dev-runtime']
}
}
},
resolveId(id: string) {
return id === runtimeId ? id : null
},
Expand Down

0 comments on commit ca142b4

Please sign in to comment.