hopkit

Find your next move

Search the guide, API, and recipes.

    Hopkit / Reference

    Build and export

    Make a production web build and a local ZIP, then test the output you intend to share.

    A generated Hopkit game includes two delivery commands. build writes a production site to dist/. export rebuilds, validates the output, and creates a ZIP under exports/ with index.html at its root.

    Package manager Build Export
    npm npm run build npm run export
    pnpm pnpm run build pnpm run export
    Bun bun run build bun run export

    The scripts use Node.js 24 or newer. Export creates a local file. It does not publish a package, upload a game, or configure hosting.

    Play the production output

    Run npm run preview, pnpm run preview, or bun run preview if your project’s manifest includes the preview script. Otherwise serve dist/ with an installed static HTTP server. Open its URL in a browser; do not double-click index.html and judge a file: page as a production result.

    Check a fresh start, the win and loss conditions, pause, restart, audio and saved progress. Resize the window. Try the controls you plan to advertise. If you host under a nested path, test that path and inspect failed network requests.

    Keep asset paths portable

    The generated Vite configuration uses relative build paths. Keep runtime-loaded asset URLs relative to the game’s document or declared asset base. A URL beginning with / points at the host’s root, which can break when your game lives inside a subdirectory or an embedded host page.

    The tutorial checkpoints pass an explicit artwork base so the same chapter works inside the documentation and in an extracted project.

    Notices belong in the export

    The exporter includes the game’s license notices and dependency attribution. Keep each asset’s original license and provenance. Replacing artwork can change what attribution you need to distribute.

    The ZIP exporter holds files in memory and rejects more than 64 MiB of input. Use a streaming exporter for larger games. A ZIP passing structural checks does not establish compatibility with every hosting service or iframe.

    Hosting is a separate decision

    Upload the production ZIP only when you are ready to publish it. Test the actual hosted URL, including its start interaction, sound policy, fullscreen behavior and storage access. A successful local export does not test those host settings.