antfu-collective / vitesse

🏕 Opinionated Vite + Vue Starter Template
https://vitesse.netlify.app/
MIT License
8.86k stars 933 forks source link

Images in public directories will be navigated to a 404 page #431

Closed 6starlong closed 1 year ago

6starlong commented 2 years ago

I fork a vitesse, add the file avatar.jpg to the public directory, and visit /avatar.jpg. When first opened, the avatar.jpg image I added was displayed normally. After refreshing, I was navigated to a 404 page, after which the page containing the image did not open properly, but a 404 page. Don't know why, what is the solution.

image

In the same directory, except favicon-dark.svg and the newly added pictures, other pictures do not have this problem, it is very strange

👉 /avatar.jpg

desired effect:/pwa-192x192.png

PiotrBaczkowski commented 2 years ago

you have to include them in Vite config file under VitePWA's includeAssets

6starlong commented 1 year ago

you have to include them in Vite config file under VitePWA's includeAssets

Thanks,this works for me