Skip to content

Commit

Permalink
feat(plugin-react): pre-optimize jsx-dev-runtime (#5036)
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Sep 22, 2021
1 parent c7abb9f commit a34dd27
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/plugin-react/src/index.ts
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 a34dd27

Please sign in to comment.