CLIActive

Vite CLI

Vite's command-line interface for starting the dev server, building for production, and previewing builds.

Open source page ↗

Product features

Product features

Build

Builds for production.

Production build

vite build builds the production version.

Config file option

-c, --config <file> uses a specified config file.

Development server

vite (aliases vite dev, vite serve) starts the Vite dev server in the current directory.

Dev server command

Starts the Vite dev server in the current directory; vite dev and vite serve are aliases.

emitDecoratorMetadata ​

Features ​

Host and port options

Hot Module Replacement ​

isolatedModules ​

npm Dependency Resolving and Pre-Bundling ​

Optimize

Pre-bundles dependencies. Deprecated: pre-bundling runs automatically.

Dependency pre-bundling

vite optimize pre-bundles dependencies; deprecated as pre-bundling runs automatically.

Other Compiler Options Affecting the Build Result ​

paths ​

Preview

Locally preview the production build.

Build preview

vite preview locally previews the build output; not intended as a production server.

target ​

Transpile Only ​

TypeScript ​

TypeScript Compiler Options ​

useDefineForClassFields ​

vite build

Builds for production.

vite build

Builds for production, with options like --target, --outDir, --ssr, --sourcemap and --minify.

vite / vite dev / vite serve

Starts the Vite dev server in the current directory; dev and serve are aliases.

vite (dev server)

Starts the Vite dev server in the current directory; vite dev and vite serve are aliases.

vite optimize

Pre-bundles dependencies; deprecated as pre-bundling runs automatically.

vite optimize

Pre-bundles dependencies. Deprecated: the pre-bundle process runs automatically.

vite preview

Locally previews the production build; not recommended as a production server.

vite preview

Locally previews the production build; not designed to be used as a production server.