Getting Started

build-preset

Shared Vite, Vitest, Capacitor, tsup, TypeScript and Biome configuration for browser games.

build-preset is the build configuration a family of browser-game repositories used to copy from each other, extracted into one package. It gives a project a Vite 8 config, Vitest unit and real-browser test fragments, a Capacitor config, a tsup library build, and shared TypeScript and Biome base configs.

It is deliberately configuration only. It has no runtime dependencies and takes no framework opinion: React, Tailwind and other plugins stay the project's own. Every factory returns a plain config object and accepts an overrides escape hatch that merges last.

Why use it?

Problembuild-preset convention
Heavy vendors (three.js, Rapier, Phaser, Tone.js) split into racing chunksRolldown codeSplitting.groups and optimizeDeps per heavyDeps toggle, or your own split by load time with chunks
A browser test run is loud, or runs headless and hides GPU bugsHeaded-only Chromium with --mute-audio built into the provider
A mid-run dependency re-bundle produces a second React instanceThe dep-optimizer pre-bundle list is part of the browser fragment
Overriding one Capacitor key discards the preset's sibling keysserver, android, ios and plugins merge one level deep
A library ships another package's banner or bundles its peerslibraryBuild derives the banner from the name and takes explicit externals
Every repo has a slightly different tsconfig and Biome setuptsconfig.base.json and biome.base.json to extend

Where to go next