Skip to content

remarkablegames/littlejs-template

Repository files navigation

LittleJS Template

LittleJS Template

release build

littlejs-template is a template for making LittleJS games.

Play the game on:

Prerequisites

Install

Clone the repository:

git clone https://github.com/remarkablegames/littlejs-template.git
cd littlejs-template

Install the dependencies:

npm install

Rename the project:

git grep -l littlejs-template | xargs sed -i '' -e 's/littlejs-template/my-game/g'
git grep -l 'LittleJS Template' | xargs sed -i '' -e 's/LittleJS Template/My Game/g'

Update the files:

  • README.md
  • package.json
  • index.html
  • public/manifest.json
  • src/index.ts

Initialize a new repository:

rm -rf .git
git init

Make your first commit:

git add .
git commit -m 'feat: initialize project from littlejs-template'

Note

Commit messages follow Conventional Commits, which helps with release.

Once you're ready, push the local repository to GitHub (or another remote repository):

git remote add origin <remote-repository-url>
git push origin -u origin master

Environment Variables

Set the environment variables:

less .env

Update the Secrets in the repository Settings.

Available Scripts

In the project directory, you can run:

npm start

Runs the game in the development mode.

Open http://localhost:5173 to view it in the browser.

The page will reload if you make edits.

You will also see any errors in the console.

npm run build

Builds the game for production to the dist folder.

It correctly bundles in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.

Your game is ready to be deployed!

npm run bundle

Builds the game and packages it into a Zip file in the dist folder.

Your game can be uploaded to your server, Itch.io, Newgrounds, etc.

License

MIT