Closed x-wink closed 6 months ago
Where have you used vite-svg-loader
in that repo? Please provide a reproducible example and error logs. Also TypeError does not mean an error with TypeScript types.
And that plugin seems to be working fine for me: https://stackblitz.com/edit/vite-xefyjs?file=docs%2Findex.md,docs%2F.vitepress%2Fconfig.ts
vite-svg-loder
's d.ts file.
your example can't show ts type when mouse hover import Test from './test.svg'
maybe you can clone my repo to trypnpm i
pnpm build:icons
pnpm dev
add /// <reference types="vite-svg-loader" />
in your vite-env.d.ts
Describe the bug
import
svg
with plugin vite-svg-loader it's type should beFunctionalComponent
this is ok in vite projects but not work in vitepress it's type isString
Reproduction
https://github.com/x-wink/wink-ui this is my repository throw type error in this file:
docs\src\examples\button\use5.vue
it's ok in this file:packages\components\select\tag.vue
Expected behavior
just like vite projects
System Info
Additional context
exists follow projects in my UI libary momorepo:
docs
is a vitepress project, dependencieicons
andcomponents
icons
is a vite project with plugin vite-svg-loadercomponents
define vue components and dependencieicons
wink-ui
is a vite project dependenciecomponents
, build and emitscomponents
I try to upgrade vitepress to latest version,it's same result.
Validations