How to import hdr files in vite?

Here is a snapshot of the code

When I build using npm run dev it doesn’t create the hdr file because it’s not imported, does anyone know how I can change vite.config.js

Easiest thing is probably to use the Vite public directory:

generally, you can never url fetch from “./…” that is a relative path, and whereever it leads is not valid because the bundler will create a single javascript file from everything inside /src. they are only used for imports. the correct path is “/hdri” and as don said, that folder has to be in /public.