You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cli): add preview command for production builds (#372)
Add a new Vite CLI subcommand that forwards arguments to the underlying Vite CLI:
- `vite preview`: Preview production build (with --port, --host, etc.)
This command follows the same pattern as existing `vite dev` and `vite build` commands.
Additionally:
- Running `vite` with no command now defaults to `vite dev`
- Running `vite` with options (like `vite --port 3000`) is treated as `vite dev`
- Added `preview` to the list of built-in commands
- Added tests for the new command
--clearScreen [boolean] allow/disable clear screen when logging
354
+
--configLoader <loader> [string] use 'bundle' to bundle the config with Rolldown, or 'runner' (experimental) to process it on the fly, or 'native' (experimental) to load using the native runtime (default: bundle)
355
+
-d, --debug [feat] [string | boolean] show debug logs
356
+
-f, --filter <filter> [string] filter debug logs
357
+
-m, --mode <mode> [string] set env mode
358
+
-h, --help Display this message
359
+
360
+
361
+
> vite dev -h # dev help message
362
+
vite/<semver>
363
+
364
+
Usage:
365
+
$ vite [root]
366
+
367
+
Commands:
368
+
[root] start dev server
369
+
build [root] build for production
370
+
optimize [root] pre-bundle dependencies (deprecated, the pre-bundle process runs automatically and does not need to be called)
371
+
preview [root] locally preview production build
372
+
373
+
For more info, run any command with the `--help` flag:
374
+
$ vite --help
375
+
$ vite build --help
376
+
$ vite optimize --help
377
+
$ vite preview --help
378
+
379
+
Options:
380
+
--host [host] [string] specify hostname
381
+
--port <port> [number] specify port
382
+
--open [path] [boolean | string] open browser on startup
383
+
--cors [boolean] enable CORS
384
+
--strictPort [boolean] exit if specified port is already in use
385
+
--force [boolean] force the optimizer to ignore the cache and re-bundle
386
+
--experimentalBundle [boolean] use experimental full bundle mode (this is highly experimental)
387
+
-c, --config <file> [string] use specified config file
388
+
--base <path> [string] public base path (default: /)
--clearScreen [boolean] allow/disable clear screen when logging
391
+
--configLoader <loader> [string] use 'bundle' to bundle the config with Rolldown, or 'runner' (experimental) to process it on the fly, or 'native' (experimental) to load using the native runtime (default: bundle)
392
+
-d, --debug [feat] [string | boolean] show debug logs
0 commit comments