@dodrin
Posted
Hi, the issue of the images not rendering on the build is because of the file path.
When you store images in the public
directory, you can access the images using their relative paths.
for example,
public/
├── index.html
├── logo.png
└── ...
In your React components,
<img src="/logo.png" alt="Logo" />
Here is the link for the Vite documentation. I hope this helps!
https://vitejs.dev/guide/assets.html#importing-asset-as-url
Marked as helpful
@yetkinkrsngr
Posted
@dodrin thankyou very much