Skip to content

Hot reload, storage & builds

npm run dev opens the editor through Vite. Source edits use the owning ecosystem’s normal module and React-refresh behavior: TSX components re-render, and React preserves hook state when the component boundary remains compatible. A remount starts a new project mount epoch so all roots that share a project module still receive one common module instance.

The editor never swaps an engine-specific behavior prototype or compiles a second scene model. When an edit changes root structure or invalidates a module boundary, the honest result is a remount rather than an attempt to preserve incompatible state.

Storage backends & the browser-first editor

Section titled “Storage backends & the browser-first editor”

The editor reads/writes through a StorageBackend (packages/editor/src/storage/): Opfs (browser OPFS), Fsa (File System Access API — a real on-disk folder), Mem (tests), and Http (the server-first /__editor/* backend). Selecting OPFS/FSA gives a browser-first, server-less editor — npm run build:web produces a static editor that needs no Node.

CommandDoes
npm run validate-assetscontent-parse .mat/.inputmap assets
npm run generate-schemaZod → JSON Schema (manifest/.inputmap/.mat)
npm run generate-engine-manifestgenerated engine API reference
web shipped; desktop wired but unproven
Build targets and their status.
  • Web (shipped): npm run build:web produces a static bundle zipped to vgai-web.zip (itch.io-ready). The in-editor Build panel (/__editor/export) runs this for you.