i an trying to build a browser game on netlify I have assets folder in my games code, but when I publish from GitHub, the file directory is compel you removed and all associated code is placed into a singular index file. When my site tries to load an image from the games code, the image path can’t be found, due to netlify removing my file structure for its own.
Sorry this isn’t the greatest post, but the site is Embrune.netlify.app
I have a splash image in my internal “assets/“ folder that is removed on building to the site
Thanks for reaching out! It sounds like your build process is bundling all your game assets into a single output file and not preserving your original folder structure during deployment. This usually happens when using a bundler or framework (like Vite, Webpack, or Parcel) that optimizes and minifies files before output.
Here are a few things you can try:
Check your build output directory — In your netlify.toml or Site Settings > Build & Deploy > Publish directory, make sure it points to the folder that actually contains your game’s assets (e.g., dist/ or build/).
Verify asset paths — If your bundler changes file paths during the build, you may need to use relative paths like ./assets/image.png instead of absolute ones, or ensure the bundler copies the assets correctly.
Inspect your build output locally — Run your build command (for example, npm run build) and then look inside the output folder to confirm if the assets exist. If they’re missing locally too, the issue lies in your build configuration, not Netlify.
If assets are missing after build — Check if your build tool needs a static asset plugin (e.g., vite copy plugin, or placing them in a public/ folder).
I’ll need to look into this, my entire game is not folder locked, it’s just in the root directory. I’ll check into the vite stuff and see if I can find out about the minification, I just used whatever my program had in it, (ai made, only really looked at game logic code myself, none of the building it up stuff)