Skip to content

Install the Three.js Typescript Boilerplate

Video Lecture

Install the Three.js Typescript Boilerplate Install the Three.js Typescript Boilerplate



This section is optional. If you completed all the sections before this, then you already have the project created. The boilerplate is useful if you have chosen to bypass all the preceding sections, or you already completed the course and you want to create a brand new Three.js TypeScript project and you would like to use a pre created project boilerplate to start with.

GitHub Repository : Three.js-TypeScript-Boilerplate

Clone the repository.

git clone
cd Three.js-TypeScript-Boilerplate
npm install
npm run dev

Open a browser and Visit

You should see a spinning green wireframe cube, and also be able to rotate it using your mouse.

This is our beginning Three.js Typescript application that we will discuss fully in the next few sections.

Cloning Into A Custom Folder

git clone will by default create a new folder being the same name as the repository and download all of the files into it. You can clone into a custom folder instead.

E.g., If you wanted to use the folder example-1

git clone ./example-1

You'd then cd into the new example-1 folder instead.

cd example-1

then install and start it.

npm install
npm run dev

Open a browser and Visit

Reverting A Git Repository Back To Head

If you clone the boilerplate, you then make some changes, and then you decide to go back to the original boilerplate, you can reset it back to the head version by typing

git reset --hard

Note that you will lose any changes that you made.