Advise on creating a Vue 2 / Vue 3 compatible component library #7055
-
I have the following library I've hit my first snag, I'm seeing the following errors:
They seem to be imported in the output build:
So. I guess these aren't named exports in vue 2.7.*. I've upgraded to the latest Vue 2.7 version., patch version I'm wondering if anyone here can provide me specific feedback as to what I have done wrong, and how to correct this seemingly minor issue? I'd be eternally grateful 🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I would recommend shipping/distributing SFCs rather than the output of compiled projects, and then directly using these in the target project. I have a WIP vite plugin for 'compiling' SFC -> distributable SFC (will share later), or you might investigate https://github.com/unjs/mkdist for a 'light transpilation' approach. If you do want to go for the compiled approach, you might also be interested in https://github.com/JessicaSachs/petite and https://github.com/vue-bridge/vue-bridge. |
Beta Was this translation helpful? Give feedback.
I would recommend shipping/distributing SFCs rather than the output of compiled projects, and then directly using these in the target project. I have a WIP vite plugin for 'compiling' SFC -> distributable SFC (will share later), or you might investigate https://github.com/unjs/mkdist for a 'light transpilation' approach.
If you do want to go for the compiled approach, you might also be interested in https://github.com/JessicaSachs/petite and https://github.com/vue-bridge/vue-bridge.