unplugin / unplugin-vue-components

📲 On-demand components auto importing for Vue
https://www.npmjs.com/package/unplugin-vue-components
MIT License
3.66k stars 341 forks source link

unable to external components using vue2 writing method when using unplugin vue components #692

Open aWestbrookFan opened 10 months ago

aWestbrookFan commented 10 months ago

Describe the bug

my project is a Vue component project, which only requires packaging components. When using unplugin vue components, packaging cannot create an external component library. Later, I wrote a vite plugin to insert components into the Vue file as needed. At this point, Vue3 can do it, while components written in Vue2 cannot be excluded

build config rollupOptions: { preserveEntrySignatures: 'strict', external: ['vue', 'axios','@enn/ency-design','element-plus', 'ElementPlusIconsVue'], output: { globals: { vue: 'Vue', axios: 'axios', 'element-plus':'ElementPlus', '@enn/ency-design': 'EncyDesign', ElementPlusIconsVue: 'ElementPlusIconsVue' } } }

Reproduction

none

System Info

pnpm

Used Package Manager

pnpm

Validations