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

找不到声明文件 #13

Closed Minori-ty closed 9 months ago

Minori-ty commented 9 months ago

image 找不到模块的声明文件,已经在tsconfig.json添加"svg-component.d.ts", "svg-component-global.d.ts"

是需要自己写这两个文件吗?写了后也失去name的类型提示

Jevon617 commented 9 months ago

@Minori-ty 提供一个最小的可复现demo

Minori-ty commented 9 months ago

@Minori-ty 提供一个最小的可复现demo

https://github.com/Minori-ty/demo.git

Jevon617 commented 9 months ago

@Minori-ty image

Minori-ty commented 9 months ago

@Minori-ty image

好的谢谢,不过不能默认配置吗?

Jevon617 commented 9 months ago

默认是false, 不是所有用户都是都用的ts

Minori-ty commented 9 months ago

默认是false, 不是所有用户都是都用的ts

好的,谢谢。

不过从优化的角度来说,是不是可以在插件启动的时候,就找一下本地是否有tsconfig.json文件,来判断该项目是否是ts项目,从而降低用户使用的心智负担?

Jevon617 commented 9 months ago

有tsconfig.json不一定就是ts项目, 没有tsconfig.json不一定不是ts项目, 不能作为判断条件, 这里如果想优化, 需要考虑的case太多.

Minori-ty commented 9 months ago

有tsconfig.json不一定就是ts项目, 没有tsconfig.json不一定不是ts项目, 不能作为判断条件, 这里如果想优化, 需要考虑的case太多.

好的