@zuke/vite
`@zuke/vite` — typed `ViteTasks` wrappers for the [Vite](https://vitejs.dev)
@zuke/vite on JSR ↗ 6 symbols
Symbols
class ViteBuildSettings extends ViteSettings Settings for vite build.
| Member | Signature | Doc |
|---|---|---|
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). |
class ViteDevSettings extends ViteSettings Settings for vite dev (the development server).
| Member | Signature | Doc |
|---|---|---|
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). |
class VitePreviewSettings extends ViteSettings Settings for vite preview (serve a production build locally).
| Member | Signature | Doc |
|---|---|---|
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). |
class ViteSettings extends ToolSettings Base for all vite subcommand settings: the binary is vite, with the --config and --mode options shared by every subcommand.
| Member | Signature | Doc |
|---|---|---|
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). |
const ViteTasks: ViteTasksApi Typed task functions for the vite CLI.
interface ViteTasksApi The shape of ViteTasks.
| Member | Signature | Doc |
|---|---|---|
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. |