Skip to content
On this page

Project Setup

Setting up a new project

To setup a new project, use degit to scaffold of thejsngin/new-project and then install the dependencies.

bash
# setup the project inside the dir `my-new-project`
npx degit thejsngin/new-project my-new-project

cd my-new-project

# install the dependencies
npm i

# serve your test project
npm run dev

You should see a cube fall to rectangular plane.

Project structure

.
├── index.html
├── package-lock.json
├── package.json
├── src
|  ├── index.d.ts
|  ├── index.ts
|  └── rootGameObject.jsnobj
└── vite.config.js

Dependencies

  • @thejsngin/jsngin is the core jsngin package that is bundled with the game.
  • @thejsngin/rollup-plugin is the rollup plugin that bundles .jsncmp and .jsnobj files. The current implementation uses Vite, however you can rollup with auxilary plugins for resolving node modules, wasm etc.
  • @dimforge/rapier3d is a peerDependency of standard-assets and is used as the default physics engine.
  • three is a peerDependency of standard-assets and is used as for rendering.
  • vite - the bundler being used
  • vite-plugin-top-level-awaitand vite-plugin-wasm are used to bundle @dimforge/rapier3d.