This project uses the superfast vite bundler. The following shows the structure of the Vite template:
assets/
- The asset folder contains exported assets from Unityinclude/
- Assets and content that need to be reference/load.index.html
src/
main.ts
- Imports the needle-engine packagesrc/scripts/
- Scriptssrc/styles/
- Stylesheets
vite.config
- The vite config. Settings for building the distribution and hosting the development server are made here.
- Node.JS version 16.4LTS or higher. Recommended Node V16
- For production builds, installation of
toktx
is required - Get the
Avatar.glb
,scene.glb
files from Download
To build the project, follow the steps below. Start by cloning the repository, then create a folder named assets
within the repository. Add the downloaded files (Avatar.glb, scene.glb)
- Open
package.json
and replace dependencies with
"dependencies": {
"@needle-tools/engine": "2.45.0-pre",
"three": "^0.146.1",
"silvadef": "file:../silvadef~"
},
-
Goto repository
silva
and copy files to a folder outside of the current directory ofpackage.json
. Rename the folder tosilvadef~
or change the path of"silvadef":
package inpackage.json
-
Run
npm run install
orpnpm install
on terminal -
For local build run
npm build:dev
orpnpm build:dev
-
For production build install
toktx
, make sure toktx is in the environment path. To check if toktx is in the environment path, open cmd and runtoktx -v
. If environment path is set correctly, expect something liketoktx v4.1.0-rc3~4
npm run build:production