vuejs / composition-api

Composition API plugin for Vue 2
https://composition-api.vuejs.org/
MIT License
4.19k stars 343 forks source link

defineComponent不支持tree-shaking #910

Closed KesionX closed 2 years ago

KesionX commented 2 years ago

我在组件库内使用capi,发现它会导致打包的时候无法tree-shaking

eg: 组件A

export default defineComponent({
   name: 'xx',
   setup() {}
})

index.js

import A from 'a.vue'

// not use A
console.log('hello');

打包后仍然会把A打入

xiaoxiangmoe commented 2 years ago

Please provide a minimal reproduction.

github-actions[bot] commented 2 years ago

Stale issue message