I have an SVG file located in the "public/img/"
directory. However, when I try to import this image file using
import imgUrl from './img/googlenews.svg';
, it doesn't seem to work.
The file path where I wrote the import
rule is (not sure if this detail is important): "src/resources/articles.ts"
Here is a snippet of my vite.config.ts
:
// Your Vite configuration goes here...
You can find more information on importing assets in the official Vite documentation.