Skip to content
SiteEmail

Installation

Terminal window
npm install -D vite-gameface-rasterize
vite.config.ts
import rasterize from 'vite-gameface-rasterize';
export default defineConfig({
plugins: [rasterize()],
});

The plugin renders with a real Gameface Player. It looks for one in this order:

  1. the playerPath option
  2. the GAMEFACE_PATH environment variable, which Vite loads from your .env

Prefer the environment variable. The Player lives in a different place on every machine, so a committed vite.config should not hard-code a path.

Terminal window
# .env (git-ignored)
GAMEFACE_PATH=D:/gameface-packages/Cohtml-3.2.0.2/Player/Player.exe

If neither is set, the build fails immediately with a clear message.

  • Vite 5 or newer
  • A Gameface Player. Developed and verified against cohtml 3.2.0. The engine version is part of every cache key, so upgrading it invalidates the bakes correctly.

Set GAMEFACE_PATH on the runner. The plugin launches and closes the Player itself with its window disabled. The bake cache in node_modules/.cache/rasterize is content-keyed, so caching that directory makes most builds a no-op.