zuke.tools.vite
@zuke/vite 1.1.0: @zuke/vite — typed ViteTasks wrappers for the [Vite](https://vitejs.dev) CLI, for use in Zuke builds.
zuke on PyPI ↗ 5 symbols
Symbols
class ViteBuildSettings(ViteSettings) Settings for vite build.
-
out_dir(path: str) -> SelfOutput directory (
--outDir). -
base(path: str) -> SelfPublic base path (
--base). -
empty_out_dir() -> SelfEmpty the output directory before building (
--emptyOutDir). -
sourcemap() -> SelfEmit source maps (
--sourcemap). -
root(path: str) -> SelfThe project root (positional).
class ViteDevSettings(ViteSettings) Settings for vite dev (the development server).
-
host(value: str) -> SelfBind to a host/IP (
--host). -
port(value: float) -> SelfServe on a specific port (
--port). -
strict_port() -> SelfFail instead of trying the next free port when port is taken (
--strictPort). A build that hands the port to something else — an e2e runner, a health check — needs the server to be on the port it asked for or not at all; without this Vite silently moves on and the other side connects to nothing. -
open() -> SelfOpen the app in the browser on start (
--open).
class VitePreviewSettings(ViteSettings) Settings for vite preview (serve a production build locally).
-
host(value: str) -> SelfBind to a host/IP (
--host). -
port(value: float) -> SelfServe on a specific port (
--port). -
strict_port() -> SelfFail instead of trying the next free port when port is taken (
--strictPort). See ViteDevSettings.strictPort. -
open() -> SelfOpen the app in the browser on start (
--open).
class ViteSettings(ToolSettings) Base for all vite subcommand settings: the binary is vite, with the --config and --mode options shared by every subcommand.
-
config(path: str) -> SelfUse an explicit config file (
--config). -
mode(name: str) -> SelfSet the mode, e.g.
productionordevelopment(--mode).
class ViteTasks Typed task functions for the vite CLI.
-
static async dev(ctx: ServiceContext, configure: Callable[[ViteDevSettings], ViteDevSettings] | None=None) -> ExecResultStart the dev server:
vite dev. -
static async build(ctx: ServiceContext, configure: Callable[[ViteBuildSettings], ViteBuildSettings] | None=None) -> ExecResultBuild for production:
vite build. -
static async preview(ctx: ServiceContext, configure: Callable[[VitePreviewSettings], VitePreviewSettings] | None=None) -> ExecResultPreview a production build:
vite preview.