Presented here is the concise summary from executing vite --help
and its subcommands in the middle of 2023.
Observe the condensed Commands section placed at the beginning, a feature that was previously absent in the CLI documentation (source code).
vite --help
vite/4.3.8
Usage:
$ vite [root]
Commands:
[root] initiate development server
build [root] compile for production
optimize [root] pre-package dependencies
preview [root] locally test production build
For more details, use any command with the `--help` flag:
$ vite --help
$ vite build --help
$ vite optimize --help
$ vite preview --help
Options:
--host [host] [string] specify hostname
--port <port> [number] specify port
--https [boolean] utilize TLS + HTTP/2
--open [path] [boolean | string] launch browser on startup
--cors [boolean] activate CORS
--strictPort [boolean] halt if specified port is already in use
--force [boolean] compel optimizer to disregard cache and re-package
-c, --config <file> [string] utilize specific configuration file
--base <path> [string] public base path (default: /)
-l, --logLevel <level> [string] info | warn | error | silent
--clearScreen [boolean] enable/disable clear screen during logging
-d, --debug [feat] [string | boolean] display debug logs
-f, --filter <filter> [string] apply filter to debug logs
-m, --mode <mode> [string] set environmental mode
-h, --help Output this message
-v, --version Display version number
vite build --help
vite/4.3.8
Usage:
$ vite build [root]
Options:
--target <target> [string] transpile target (default: 'modules')
--outDir <dir> [string] output directory (default: dist)
--assetsDir <dir> [string] directory under outDir to place assets in (default: assets)
--assetsInlineLimit <number> [number] static asset base64 inline threshold in bytes (default: 4096)
--ssr [entry] [string] build specified entry for server-side rendering
--sourcemap [output] [boolean | "inline" | "hidden"] output source maps for build (default: false)
--minify [minifier] [boolean | "terser" | "esbuild"] enable/disable minification, or specify minifier to use (default: esbuild)
--manifest [name] [boolean | string] emit build manifest json
--ssrManifest [name] [boolean | string] emit ssr manifest json
--force [boolean] force the optimizer to ignore the cache and re-bundle (experimental)
--emptyOutDir [boolean] force empty outDir when it's outside of root
-w, --watch [boolean] rebuilds when modules have changed on disk
-c, --config <file> [string] use specified config file
--base <path> [string] public base path (default: /)
-l, --logLevel <level> [string] info | warn | error | silent
--clearScreen [boolean] allow/disable clear screen when logging
-d, --debug [feat] [string | boolean] show debug logs
-f, --filter <filter> [string] filter debug logs
-m, --mode <mode> [string] set env mode
-h, --help Output this message
vite optimize --help
vite/4.3.8
Usage:
$ vite optimize [root]
Options:
--force [boolean] force the optimizer to ignore the cache and re-bundle
-c, --config <file> [string] use specified config file
--base <path> [string] public base path (default: /)
-l, --logLevel <level> [string] info | warn | error | silent
--clearScreen [boolean] allow/disable clear screen when logging
-d, --debug [feat] [string | boolean] show debug logs
-f, --filter <filter> [string] filter debug logs
-m, --mode <mode> [string] set env mode
-h, --help Output this message
vite preview --help
vite/4.3.8
Usage:
$ vite preview [root]
Options:
--host [host] [string] specify hostname
--port <port> [number] specify port
--strictPort [boolean] exit if specified port is already in use
--https [boolean] utilize TLS + HTTP/2
--open [path] [boolean | string] launch browser on startup
--outDir <dir> [string] output directory (default: dist)
-c, --config <file> [string] use specified config file
--base <path> [string] public base path (default: /)
-l, --logLevel <level> [string] info | warn | error | silent
--clearScreen [boolean] allow/disable clear screen when logging
-d, --debug [feat] [string | boolean] show debug logs
-f, --filter <filter> [string] filter debug logs
-m, --mode <mode> [string] set env mode
-h, --help Output this message