@zuke/vite

← API reference

`@zuke/vite` — typed `ViteTasks` wrappers for the [Vite](https://vitejs.dev)

Symbols

# ViteBuildSettings class
class ViteBuildSettings extends ViteSettings

Settings for vite build.

MemberSignatureDoc
outDir outDir(path: PathLike): this Output directory (--outDir).
base base(path: string): this Public base path (--base).
emptyOutDir emptyOutDir(): this Empty the output directory before building (--emptyOutDir).
sourcemap sourcemap(): this Emit source maps (--sourcemap).
root root(path: PathLike): this The project root (positional).
# ViteDevSettings class
class ViteDevSettings extends ViteSettings

Settings for vite dev (the development server).

MemberSignatureDoc
host host(value: string): this Bind to a host/IP (--host).
port port(value: number): this Serve on a specific port (--port).
open open(): this Open the app in the browser on start (--open).
# VitePreviewSettings class
class VitePreviewSettings extends ViteSettings

Settings for vite preview (serve a production build locally).

MemberSignatureDoc
host host(value: string): this Bind to a host/IP (--host).
port port(value: number): this Serve on a specific port (--port).
open open(): this Open the app in the browser on start (--open).
# ViteSettings class
class ViteSettings extends ToolSettings

Base for all vite subcommand settings: the binary is vite, with the --config and --mode options shared by every subcommand.

MemberSignatureDoc
config config(path: PathLike): this Use an explicit config file (--config).
mode mode(name: string): this Set the mode, e.g. production or development (--mode).
# ViteTasks const
const ViteTasks: ViteTasksApi

Typed task functions for the vite CLI.

# ViteTasksApi interface
interface ViteTasksApi

The shape of ViteTasks.

MemberSignatureDoc
dev dev(configure?: Configure<ViteDevSettings>): Promise<CommandOutput> Start the dev server: vite dev.
build build(configure?: Configure<ViteBuildSettings>): Promise<CommandOutput> Build for production: vite build.
preview preview(configure?: Configure<VitePreviewSettings>): Promise<CommandOutput> Preview a production build: vite preview.