Build Process
Stims uses Vite to build optimized production assets. The build process outputs to thedist/ directory with hashed assets for efficient caching.
Production Build
Build the site for production:dist/: HTML entry points and hashed JS/CSS assets underdist/assets/dist/.vite/manifest.json: Vite manifest mapping original sources to their output filenames
The manifest file is required for asset lookups and debugging. Do not remove the
.vite directory when deploying.Reusing Existing Build
If you already have a validdist/ folder (for example, when deploying prebuilt artifacts from CI), skip the rebuild:
Preview Locally
Validate the production build before deploying using one of these preview methods:bun run build and serve from the dist/ directory. The preview server binds to all interfaces and is accessible at http://localhost:4173.
Pre-Deployment Checklist
Run these quality checks before deploying to production:Run quality gate
Execute the full quality gate to catch issues:This runs Biome linting, TypeScript type checking, and tests.
If any step fails, fix the issue and restart from step 1 so downstream checks reflect the final state.
Multiple HTML Entry Points
The project includes several standalone HTML entry points:index.html- Main homepagetoy.html- Individual toy viewer- Additional toys in
toys/directory (e.g.,legible.html,multi.html,symph.html)
Validation Steps
- Run
bun run buildfollowed bybun run preview - Manually open each entry point path (e.g.,
http://localhost:4173/legible.html) - Test audio or interaction-specific features with at least one interaction test (mic input, pointer/touch)
- Repeat checks against preview URLs to ensure CDN caching and asset references work correctly
Deployment Options
Stims supports multiple deployment targets:Cloudflare Pages
Recommended platform with automatic preview deployments and global CDN
Static Hosting
Any static host that can serve the dist/ directory
Build Configuration
The build is configured invite.config.js with these key settings:
- Output directory:
dist - Target: ES2020
- Chunk size limit: 550KB (increased for WebGPU renderer bundle)
- Manifest: Enabled for asset resolution
- Entry preservation: Strict signature preservation for dynamic imports
Dynamic Entry Detection
Vite automatically discovers HTML entry points and module entries fromassets/data/toys.json:
- All
.htmlfiles in the root andtoys/directory - Module-type toys from the toys manifest
- Dynamic imports with preserved
startfunctions