Skip to main content
Once your game is working in Storybook, follow these steps to produce a production build, upload it to Stake Engine, and connect a local DEV server to the live RGS for end-to-end testing.
1

Build the game

Run the build command from the repo root, using TurboRepo’s --filter flag to target the lines game (or replace lines with your game’s package name):
pnpm run build --filter=lines
The SvelteKit build produces two output directories inside apps/lines/.svelte-kit/output/:
PathContents
prerendered/pages/index.htmlThe pre-rendered entry HTML file
client/All client-side JavaScript, CSS, and static assets
2

Assemble the build folder

Create a new folder (e.g. build/) anywhere on your machine. Copy the index.html and the entire contents of the client/ directory into it so the final structure looks like this:
build/
  |- index.html
  |- _app/
  |- assets/
  |- favicon.svg
  |- loader.gif
  |- stake-engine-loader.gif
The index.html comes from apps/lines/.svelte-kit/output/prerendered/pages/index.html. Everything else comes from apps/lines/.svelte-kit/output/client/.
3

Upload to Stake Engine

  1. Log in to Stake Engine.
  2. Navigate to the Files page of your game.
  3. Click Import and select your entire build/ folder to upload the frontend assets.
  4. Once the upload completes, click the Publish Game button and select Front End.
4

Start a game session and verify

  1. Go to the Developer page in Stake Engine.
  2. Click Start game session.
  3. Click Launch in New Tab.
The game opens in a staging environment connected to the live RGS. You can interact with all controls and verify the full round-trip from bet to result.
5

Connect DEV mode to the RGS

The URL of the launched game contains a query string with the authentication parameters needed to connect to the RGS. Copy the full query string from the browser address bar.Start the local dev server:
pnpm run dev --filter=lines
Paste the copied query string into the URL of your local dev server. The authentication error screen will resolve and the game will connect to the live RGS, giving you hot-reloading development against a real backend.
This workflow is useful for debugging game behaviour that can only be reproduced with real RGS data. For most day-to-day development, Storybook with local book data is faster—see the Quickstart.

Rebuilding packages

If you modify source files inside packages/pixi-svelte, those changes won’t take effect automatically because the package is resolved from its compiled output. Rebuild it before running your game:
pnpm run build --filter=pixi-svelte
This applies to any package that specifies a main field pointing to a built artifact in its package.json.

Build docs developers (and LLMs) love