Jevon617 / unplugin-svg-component

generate a vue/react component through svg files, supporting svg file HMR, Tree-shaking, SSR and TS hint.
MIT License
58 stars 5 forks source link

Cannot find module '~virtual/svg-component' or its corresponding type declarations. #18

Open gradyll opened 7 months ago

gradyll commented 7 months ago

I built vue2 in webpack5 using typescript patterns, and when introducing ~virtual/svg-component in main.ts, Cannot find module '~virtual/svg-component' or its corresponding type declarations is displayed. You should add a type declaration to the webpack.

Jevon617 commented 7 months ago

Have you set dts=true?

upleave commented 4 days ago

Have you set dts=true?

设置了还是报一样的错误 这是我vite.config.ts的配置: image

这是我tscofign.app.json的配置: image

Jevon617 commented 4 days ago

@upleave 可以提供一个最小的复现demo吗?

upleave commented 4 days ago

@upleave 可以提供一个最小的复现demo吗?

svg-component.d.ts 和 svg-component-global.d.ts 文件生成出来后就没问题了,可能是我添加dts:true之后要等一阵才能生成完。

谢谢解答!