flet publish

Compile and package a Flet app as a standalone static web application.

Usage

flet publish [-h] [-v] [--pre] [-a ASSETS_DIR] [--distpath DISTPATH] [--app-name APP_NAME] [--app-short-name APP_SHORT_NAME] [--app-description APP_DESCRIPTION] [--base-url BASE_URL] [--web-renderer {auto,canvaskit,skwasm}] [--route-url-strategy {path,hash}] [--pwa-background-color PWA_BACKGROUND_COLOR] [--pwa-theme-color PWA_THEME_COLOR] [--no-cdn] [script]

Positional Arguments

  • script: Path to the Python script that starts your Flet app.
  • * Default: .

    Options

  • --app-description APP_DESCRIPTION:
  • * Short description of the application. Used in PWA manifests and metadata.
  • --app-name APP_NAME:
  • * Full name of the application. Used in PWA metadata and install prompts.
  • --app-short-name APP_SHORT_NAME:
  • * Shorter version of the application name, used in homescreen icons or install prompts.
  • -a, --assets ASSETS_DIR:
  • * Path to a directory containing static assets (e.g., images, fonts, icons).
  • --base-url BASE_URL:
  • * Base URL path to serve the app from. Useful for subdirectory hosting.
  • --distpath DISTPATH:
  • * Directory where the published web app should be placed. * Default: dist
  • -h, --help:
  • * Show this help message and exit.
  • --no-cdn:
  • * Disable loading of CanvasKit, Pyodide, and fonts from CDNs. For offline or air-gapped deployments.
  • --pre:
  • * Allow micropip to install pre-release Python packages.
  • --pwa-background-color PWA_BACKGROUND_COLOR:
  • * Initial background color of the web app during loading (used in splash screens).
  • --pwa-theme-color PWA_THEME_COLOR:
  • * Default color of the browser UI (e.g., address bar) when the app is installed as a PWA.
  • --route-url-strategy {path,hash}:
  • * Controls how routes are handled in the browser. * Possible values: hash, path * Default: path
  • -v, --verbose:
  • * Enable verbose output.
  • --web-renderer {auto,canvaskit,skwasm}:
  • * Flutter web renderer to use. * Possible values: auto, canvaskit, skwasm * Default: auto