This guide is for developers who want to try out Blit-Tech Demos before Blit-Tech is published to npm.
Blit-Tech Demos depends on Blit-Tech via a pnpm workspace dependency:
{
"dependencies": {
"blit-tech": "workspace:*"
}
}Since Blit-Tech is not yet on npm, you need to clone both repositories and set up a local workspace.
The demos require WebGPU support:
- Chrome/Edge 113+
- Firefox 141+ on Windows; 145+/147+ on macOS; Nightly on Linux
- Safari 26+; or Safari 18-25 with WebGPU enabled via Feature Flags
mkdir blit-tech-workspace
cd blit-tech-workspacegit clone https://github.com/vancura/blit-tech.git
git clone https://github.com/vancura/blit-tech-demos.gitCreate a pnpm-workspace.yaml file in the workspace root:
cat > pnpm-workspace.yaml << 'EOF'
packages:
- "blit-tech"
- "blit-tech-demos"
EOFpnpm installAfter setup, your directory should look like this:
blit-tech-workspace/ # Your workspace root
├── pnpm-workspace.yaml # Links the two packages
├── package.json # Optional (see below)
├── node_modules/ # Shared dependencies
├── blit-tech/ # The library
│ ├── src/
│ ├── dist/ # Built output
│ └── package.json
└── blit-tech-demos/ # The demos
├── src/ # One JS file per demo (single source of truth)
├── _partials/ # Shared HTML template
├── plugins/ # virtual-demos Vite plugin
└── package.json
You can optionally create a package.json in the workspace root:
Prerequisite: Node.js >= 20.0.0 is required before installing pnpm.
{
"name": "blit-tech-workspace",
"version": "0.0.0",
"private": true,
"packageManager": "pnpm@10.26.2"
}This is not required but can help with pnpm version pinning.
cd blit-tech-demos
pnpm devOpens browser at http://localhost:5173/demos/001-basics.html (or visit /demos/ for the full index).
If you want to edit the Blit-Tech library and see changes instantly:
cd blit-tech-demos
pnpm dev:watchThis runs two processes concurrently:
- Watches
blit-tech/srcand rebuilds on changes - Runs Vite dev server with hot module reload
If you want to rebuild the library:
cd blit-tech
pnpm buildThen the demos will use the newly built version.
Once Blit-Tech is published to npm, you can:
- Clone just
blit-tech-demos - Run
pnpm install - Start developing
The workspace setup will no longer be needed.
Cause: Workspace structure not set up correctly
Fix: Ensure you have:
- Both repos cloned as siblings
pnpm-workspace.yamlin the parent directory- Ran
pnpm installfrom the workspace root
Cause: pnpm can't find the workspace
Fix: Check that:
pnpm-workspace.yamlexists in the parent directory- Both Blit-Tech and Blit-Tech Demos are listed in the config
- You're running commands from inside the workspace structure
Cause: Blit-Tech library not built
Fix:
cd blit-tech
pnpm install
pnpm build
cd ../blit-tech-demos
pnpm devIf this setup seems complex, you can wait for Blit-Tech to be published to npm. Once published, installation will be a simple:
npm create vite@latest my-demo --template vanilla
cd my-demo
npm install blit-techCheck the Blit-Tech repository for publication status.