Skip to main content

Prerequisites

Before building, make sure you have the following installed:
  • Node.js 20 — the version specified in .nvmrc. Use nvm or any Node version manager.
  • pnpm — enabled via corepack (corepack enable)
  • Git — required at build time; webpack runs git rev-parse HEAD to embed the commit hash in asset paths
The build will fail if the repository is not a git checkout with a valid HEAD. Building from a downloaded ZIP archive is not supported without modification.

Setup

1

Clone the repository

git clone https://github.com/stremio/stremio-web.git
cd stremio-web
2

Enable pnpm

corepack enable
3

Install dependencies

pnpm install
The lockfile is committed — this installs exact versions for a reproducible build.
4

Run a build

pnpm run build
The production build writes output to the build/ directory. The development server starts a local HTTPS server on 0.0.0.0 using webpack-dev-server.

Build output

After a successful production build, the build/ directory contains:
build/
├── index.html                        # App entry point
├── manifest.json                     # Web app manifest (PWA)
├── favicons/                         # Favicon assets
├── images/                           # Static image assets
├── screenshots/                      # PWA store screenshots
├── fonts/                            # Font files (.ttf)
├── .well-known/                      # Well-known resource files
└── <commit-hash>/
    ├── scripts/
    │   ├── main.js                   # Bundled application
    │   └── worker.js                 # Stremio Core web worker
    ├── styles/
    │   └── main.css                  # Extracted CSS
    └── binaries/
        └── *.wasm                    # WebAssembly binaries
All scripts, styles, and WASM files are nested under the commit hash. This path prefix makes long-term caching safe — each deployment produces paths that have never been served before.

webpack environment variables

The following variables can be passed to webpack at build time using --env:
pnpm run build --env SENTRY_DSN=https://[email protected]/123
VariableDefaultDescription
SENTRY_DSNnullSentry DSN for error reporting. Omit to disable.
SERVICE_WORKER_DISABLEDfalseDisable service worker registration.
DEBUGfalse (production), true (development)Enable debug output.
VERSIONpackage.json version fieldApp version string.
COMMIT_HASHgit rev-parse HEADEmbedded automatically; not normally overridden.
All variables are resolved at build time and baked into the static bundle. They cannot be changed at runtime without rebuilding.

Development server

The dev server is configured in webpack.config.js:
  • Binds to 0.0.0.0 (all interfaces)
  • Uses HTTPS — required because stremio-core-web uses APIs (such as SharedArrayBuffer) that need a secure context
  • Hot reload and live reload are disabled; restart the server to pick up changes to config
pnpm start
The dev server does not produce files on disk. Use pnpm run build when you need a deployable artifact.
To run the dev server in production mode (minified output, service worker enabled):
pnpm run start-prod

Build docs developers (and LLMs) love