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
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
I upgraded Vite to 3.0.0-beta.0 to resolve this issue, which prevents me from using v2.9 right now.
However, tree-shaking fails for every library I import in v3, despite working properly in v2.9.
The reproduction example imports a single icon from an external library (@heroicons/react) with the following JS bundle sizes when runing
vite build
:v3.0.0-beta.0 / @vitejs/plugin-react v2.0.0-beta.0
239.07 KiB / gzip: 60.83 KiB
v2.9.12 / @vitejs/plugin-react v1.3.2
140.52 KiB / gzip: 45.34 KiB
The v3 repo is attached in the reproduction link.
Here is the v2.9 repo for comparison: https://github.com/bysja/vitejs-vite-v2-treeshaking
Reproduction
https://github.com/bysja/vitejs-vite-v3-treeshaking
System Info
Used Package Manager
npm
Logs
v3
❯ npm run build
$ vite build
vite v3.0.0-beta.0 building for production...
✓ 14 modules transformed.
dist/assets/react.35ef61ed.svg 4.03 KiB
dist/index.html 0.44 KiB
dist/assets/index.3fce1f81.css 1.37 KiB / gzip: 0.71 KiB
dist/assets/index.eebf1dba.js 239.07 KiB / gzip: 60.83 KiB
v2.9
❯ npm run build
$ vite build
vite v2.9.12 building for production...
✓ 266 modules transformed.
dist/assets/react.35ef61ed.svg 4.03 KiB
dist/index.html 0.44 KiB
dist/assets/index.b9195027.css 1.37 KiB / gzip: 0.71 KiB
dist/assets/index.ba61e0ad.js 140.52 KiB / gzip: 45.34 KiB
Validations
The text was updated successfully, but these errors were encountered: