withDefaults object variable results in non-tree-shakable component #9500
Labels
🔨 p3-minor-bug
Priority 3: this fixes a bug, but is an edge case that only affects very specific usage.
scope: compiler
Vue version
3.3.4
Link to minimal reproduction
https://stackblitz.com/edit/vitejs-vite-3cmbr7?file=dist%2Fassets%2Findex-311591ca.js
Steps to reproduce
npm run build
dist/assets/index-....js
and scroll to the bottomNonTreeshakable
What is expected?
Component should be tree-shaken
What is actually happening?
Component isn't tree-shaken because it compiles to
mergeDefaults
ends up being used at the top level and isn't marked as sideEffect-free.System Info
No response
Any additional comments?
I ran into this after looking into why radix-vue seems way too large compared to how small my imported components are.
Their
PopperContent.vue
leads to this exact problem.The text was updated successfully, but these errors were encountered: