jpkleemans / vite-svg-loader

Vite plugin to load SVG files as Vue components
MIT License
555 stars 59 forks source link

When i use ?component suffix, vite production build cannot find modules #59

Closed ZWLau closed 2 years ago

ZWLau commented 2 years ago

?component suffix works fine in development mode, but when in production mode, the corresponding module cannot be found error TS2307: Cannot find module '@/assets/icons/delete.svg?component' or its corresponding type declarations.

codfish commented 1 year ago

@ZWLau why'd you close? what was the solution?

ZWLau commented 1 year ago

@ZWLau why'd you close? what was the solution?

add the global component type definition to compilerOptions.types in tsconfig.json