Skip to content

Commit

Permalink
fix: disable old workaround by mutating optimizeDeps.include
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Apr 28, 2022
1 parent 1806600 commit 1069536
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/plugin-react/src/index.ts
Expand Up @@ -361,9 +361,12 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
reactPackageRoot,
'cjs/react-jsx-runtime.production.min.js'
)
// These must be optimized since they are CommonJS.
optimizeDeps.include = [
...(optimizeDeps.include || []),
...(optimizeDeps.include || []).filter(
// Disable old workaround so unnecessary work is avoided.
(id) => id !== prodRuntimeId && id !== devRuntimeId
),
// These must be optimized since they are CommonJS.
prodEntry,
devEntry
]
Expand Down

0 comments on commit 1069536

Please sign in to comment.