Commands

litestar_vite.commands.to_json(value: Any) str[source]

Serialize JSON field values.

Parameters:

value – Any json serializable value.

Returns:

JSON string.

litestar_vite.commands.init_vite(app: Litestar, root_path: Path, resource_path: Path, asset_url: str, public_path: Path, bundle_path: Path, enable_ssr: bool, vite_port: int, hot_file: Path, litestar_port: int) None[source]

Initialize a new Vite project.

Parameters:
  • app – The Litestar application instance.

  • root_path – Root directory for the Vite project.

  • resource_path – Directory containing source files.

  • asset_url – Base URL for serving assets.

  • public_path – Directory for static files.

  • bundle_path – Output directory for built files.

  • enable_ssr – Enable server-side rendering.

  • vite_port – Port for Vite dev server.

  • hot_file – Path to hot reload manifest.

  • litestar_port – Port for Litestar server.

litestar_vite.commands.execute_command(command_to_run: list[str], cwd: str | Path | None = None) subprocess.CompletedProcess[bytes][source]

Run Vite in a subprocess.