You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.
vitejs/vite#218 and vitejs/vite-plugin-react#5 fix this.
I resolve the rollup external config with resolver before calling rollup to optimize. So that the rollup external config will be @pika/react/source.development.js instead of @pika/react.
The text was updated successfully, but these errors were encountered:
csr632
changed the title
React is bundled when optimizing deps
React is not externaled when optimizing deps
May 21, 2020
Reproduce:
https://github.com/csr632/test-vite/tree/debug-plugin-react
After optimize, go to
node_modules/.vite_opt_cache/styled-components
, search forreact.development.js
in it. You can see react is bundled.Investigate
When optimizing
styled-components
, react is resolved into@pika/react/source.development.js
:https://github.com/vitejs/vite-plugin-react/blob/a37f540ab16bfe256273b7719e9432a4b3b4efdf/src/resolver.ts#L7
but the rollup external config is
@pika/react
Fix
vitejs/vite#218 and vitejs/vite-plugin-react#5 fix this.
I resolve the rollup external config with resolver before calling rollup to optimize. So that the rollup external config will be
@pika/react/source.development.js
instead of@pika/react
.The text was updated successfully, but these errors were encountered: