Replies: 2 comments 2 replies
-
Can you analyze your bundle with https://www.npmjs.com/package/rollup-plugin-visualizer? |
Beta Was this translation helpful? Give feedback.
2 replies
-
I'm another user of vite & antd and having the same results. Tons of antd code I'm not using is being pulled in. I would argue that something in the antd codebase is not designed properly for free shaking. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using AntD and dealing with huge bundle results. I know for a fact that Vite does tree shaking by default and antD should be compatible with it.
But if for example you create a vite app, install and and import only a
Button
component your bundle will be huge:npm create vite@latest test -- --template react && cd test
npm install antd
Button
inside./src/app.jsx
and use it somewhere.npm run build
and see the total amount of bundle.In my case it is something like this:
Considering that by default the Vite boilerplate will have 142kb, if we rest that to 268 we still have 126kb for a single button. Is this fine or maybe vite is not doing the tree shaking?
Thanks in advance for any help or insights!
Beta Was this translation helpful? Give feedback.
All reactions