Uploading your Three.js project to Itch.io (Original title: To many files to upload)

Hello,
I am getting started with Three.js and it has been splendid so far.
Now I would like to be able to upload my stuff to Itch io, but I do not understand how.
If I zip the whole directory, then there are to many files to upload, but if I zip it without them, I just get a grey square instead of my project.

So far I have also tried to compress it with Build instructions · mrdoob/three.js Wiki · GitHub but that did not work and also uses many deprecated functions.

Does anyone have a solution for me?

I’m a bit confused! Are you referring to scene assets, three.js modules, or are you trying to build your own version of three.js? The link you shared seems to be about building the three.js library itself.

Oh sorry,
I am trying to make my Three.js project able to be uploaded to Itch io.
I can not do this right now, as the project contains to many individual files.
All of those files come from the node modules and I do not know how I would compress the project or use a different way, so that I would be able to upload it to Itch io

Your project is running in a Node environment. I’ll assume you’re using Vite, as it’s commonly the go-to build tool for Three.js projects (Installation - Option 1: Install with NPM and a build tool).

To deploy your game to Itch.io, follow these steps:

  1. Build your project using vite, usually done with npm run build.
  2. Zip the output folder, typically the dist directory at the root of your project.
  3. Upload the ZIP file to Itch.io using this guide: Uploading HTML5 games.

You don’t need to worry about node_modules, Vite handles bundling, tree-shaking, and optimization for you. If needed, you can further reduce bundle size by installing Vite plugins and customizing your vite.config.js file, depending on your project’s requirements.

2 Likes

I have done what you said and can now host my projects on trickle. They work there.
On Itch.io however there is still a grey screen.

This is the trickle site: https://8xhhmnt4gt97.trickle.host/

This is what I uploaded to Itch.io as a a test:
test.zip (116.2 KB)

Do you have any idea why?

This is the Itch.io site: Cube goes rotate by Harnekampf

Try setting Vite base to relative path in vite.config.js

// vite.config.js
import { defineConfig } from 'vite'

export default defineConfig({
  base: '', // 👈  or './'
})
1 Like

When I put a config.js or a vite.config.js with this script in my directory, it does not work.
Do I have to write some sort of command?
If I write “vite --config config.js” (which the documentation says I should (Configuring Vite | Vite) I get the error “The term ‘vite’ is not recognized as the name of a cmdlet”.

This is how I did it:
![vite-project 5_18_2025 4_11_53 PM|601x230]
(upload://iZgQuy0ElTcQQPIBRgIS8aMQF46.png)

Make sure Vite is installed:

npm install --save-dev vite

Or visit Getting Started | Vite, to start a new Vite project.

I’ve put together a quick demo project using Vite and Three.js, and deployed it on itch. Feel free to check it out:

1 Like

Thank you very much,
I had to globally install vite, as a vite install just for this project did not work (can be done
with “npm install -g vite”, ‘vite’ is not recognized as an internal or external command | GeeksforGeeks).

1 Like