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 Sep 23, 2021
1 parent 94ecc91 commit 82266e5
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 @@ -249,6 +249,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 82266e5

Please sign in to comment.