pakholeung37 / vite-plugin-vue2-svg

load SVG files as Vue components, for Vue2.x only.
MIT License
19 stars 9 forks source link

fix vue-template-compiler < 2.7 #6

Closed uyarn closed 2 years ago

uyarn commented 2 years ago

Hi, @pakholeung37 As we know, vue 2.7 which enables developers use composition API in vue2 directly was released last week. and vue-template-compiler 2.7 was released at the same time.

vue-template-compiler wasn't needed in 2.7 any longer

image

However, project using @vue/composition-api is incompatible with vue 2.7+, so we need vue< 2.7 and vue-template-compiler < 2.7 as well. Could you please modify the vue-template-compiler version from '^2.6.0' to '~2.6.0'. Otherwise, vue-template-compiler 2.7 would be installed and the warning that vue and vue-template-compiler are mismatch would appear: (

Cheers : )

pakholeung37 commented 2 years ago

Do you use vite-plugin-vue2? Do it throw the same warning?

uyarn commented 2 years ago

Do you use vite-plugin-vue2? Do it throw the same warning?

Yeap, but as you can see below, vue-template-compiler is the peerDependency of vite-plugin-vue2 so that the vue-template-compiler@2.7 wouldn't be installed once we install vue-template-compiler by ourself.

image
pakholeung37 commented 2 years ago

Would it be better for me to set peer dependencies either?

uyarn commented 2 years ago

Would it be better for me to set peer dependencies either?

can't agree more :) better alternative. and don't forget to set it as your devDep for develop as well :)