Hi,
This vue-svg-loader is really useful and I used it successfully with some JS projects.
Now I'm trying to use it in a project with Nuxt and Typescript and I cannot make Typescript understand that my SVGs are Vue component.
I get this error: Cannot find module '../assets/icons/notification.svg'
The path is right, it compiles (with errors) and works well in dev mode, but then I can't build for prod because of the errors.
I tried adding this in my index.d.ts without success:
import Vue from 'vue';
declare module '*.svg' {
export default Vue;
}
Do you know how I can fix that? Thanks!
Ok, I found a way to fix it 馃槃
I made a new file svg.d.ts (I have other typings in index.d.ts) and modified the declaration like this:
declare module '*.svg' {
import Vue from 'vue';
export default Vue;
}
I suggest you had an explanation in the README (eg: vue-svg-icon-loader).
Thank you @Godefroy for reporting this!
I added the section with the solution in the docs:
https://vue-svg-loader.js.org/faq.html#how-to-use-this-loader-with-typescript
Most helpful comment
Ok, I found a way to fix it 馃槃
I made a new file
svg.d.ts(I have other typings inindex.d.ts) and modified the declaration like this:I suggest you had an explanation in the README (eg: vue-svg-icon-loader).