CLI
This chapter covers the VuReact command-line entry, parameters, and actual behaviors.
Commands
build [root]
One-time compilation without continuous monitoring.
bash
# By default, uses the `src` directory under the running path of the command line
npx vureact build
# Specify the input path
npx vureact build ./srcwatch [root]
After the initial full compilation, enters file monitoring and incremental recompilation.
bash
npx vureact watch
npx vureact watch ./srcConfiguration Loading and Priority
The CLI first attempts to load vureact.config.js / vureact.config.ts from the root directory, then merges in command-line parameters. Priority:
- CLI parameters
- Configuration File
- Default values
Parameters
| Parameter | Description |
|---|---|
-i, --input <dir> | Input directory (relative to root) |
-o, --outDir <dir> | Output directory name (relative to workspace) |
--workspace <dir> | Compilation workspace directory (cache + output) |
Watch Mode Behavior
- Executes a full compilation once at startup.
- Monitors file changes under the
inputdirectory. .vuefiles trigger SFC compilation;.js/.tsfiles trigger script compilation; other files are copied as resource files.- Deleting files/directories will synchronously clean up output artifacts and cache records.
