Skip to content

Static deployment

From your application folder:

pyreact-forge build
pyreact-forge serve

dist/ is the application output. The preview command serves that existing output; if it does not exist, it creates a build. After changing app source, build again before previewing a production export.

Include the runtime for offline hosting

pyreact-forge vendor
pyreact-forge build --offline

Copy all of dist/, including the vendor runtime and dependency notices, to your static host. A CDN build fetches Pyodide on first load; an offline build contains those files locally. Optional installed Python packages and your own network calls can introduce additional network dependencies.

Host requirements

  • Serve over HTTP/HTTPS, not file://.
  • Serve .mjs as JavaScript and .wasm as application/wasm.
  • Fall back to index.html for application routes such as /users/42.
  • Deploy at the origin root in this alpha: /, not /repository-name/.
  • Treat the exported Python as public client code.

pyreact-forge serve is a local preview server, not a hardened application server. Use your normal static host/CDN for public delivery. Deploy into a clean output location if you remove public assets, because this alpha does not manage every stale file in a reused output directory.

GitHub Pages distinction

The documentation site supports a GitHub Pages project subpath because Zensical generates its links using site_url. The application exporter currently does not. The included Pages workflow publishes documentation, not the framework's interactive demo app.

For initial HTML generated on a server, continue with SSR.