Vue · Senior · Question 67 of 75
How do you build a Vue component library with Vite without bundling Vue itself?
- ✓Correct answer: Use library mode and mark
vueas external inrollupOptions - 2Copy Vue into the library bundle
- 3Vite can't build libraries
Explanation
Bundling Vue would create two Vue instances in the consumer app, breaking reactivity and provide/inject.