Open amitchaudhary140 opened 1 year ago
You need to change your Vite config to use @vitejs/plugin-vue
instead of @vitejs/plugin-vue2
.
I'm guessing that you are following Vue's migration build? It isn't very clear in the instructions that you need to change it.
I have developed my library using Vue 2.7 and vue-demi with Vite. I am able to consume the library in Vue 2.7 and everything is working fine but not in Vue 3.
As soon as I use any of the components from my library, I get below errors in browser console and my components are not instantiated/mounted.
It seems Vue 3 does not work well with Vue 2. But then what is the point of using vue-demi?
The workaround that I have been trying is to publish two separate packages for each version with below scripts:
Now when I try to build for Vue 2, it throws below error:
Please let me know what I should do.