
Vite will be used during development, but it isn't part of the final webpage. Install three.js and a build tool,, using a in your project folder. We'll need it to load manage dependencies and to run our build tool.

With a build tool, importing local JavaScript files and npm packages should work out of the box, without import maps. Installing from the and using a is the recommended approach for most users - the more dependencies your project needs, the more likely you are to run into problems that the static hosting cannot easily resolve. Option 1: Install with NPM and a build tool Development Both options are explained in the sections below. Installation and local development can be accomplished with npm and a build tool, or by importing three.js from a CDN. Now that we've set up the basic project structure, we need a way to run the project locally and access it through a web browser. Usually textures, audio, and 3D models will go here.

The public/ folder is sometimes also called a "static" folder, because the files it contains are pushed to the website unchanged. The structure and naming choices below aren't required, but will be used throughout this guide for consistency. Every three.js project needs at least one HTML file to define the webpage, and a JavaScript file to run your three.js code.
