diff --git a/packages/vite/src/node/build.ts b/packages/vite/src/node/build.ts index b42a8976c3f758..56e2c7422a67de 100644 --- a/packages/vite/src/node/build.ts +++ b/packages/vite/src/node/build.ts @@ -437,7 +437,7 @@ async function doBuild( // watch file changes with rollup if (config.build.watch) { - config.logger.info(chalk.cyanBright(`watching for file changes...`)) + config.logger.info(chalk.cyanBright(`\nwatching for file changes...`)) const output: OutputOptions[] = [] if (Array.isArray(outputs)) { @@ -469,6 +469,8 @@ async function doBuild( watcher.on('event', (event) => { if (event.code === 'BUNDLE_START') { + config.logger.info(chalk.cyanBright(`\nbuild started...`)) + // clean previous files if (options.write) { emptyDir(outDir) diff --git a/packages/vite/src/node/cli.ts b/packages/vite/src/node/cli.ts index 7eb84a495de6e3..41ed363388d7a7 100644 --- a/packages/vite/src/node/cli.ts +++ b/packages/vite/src/node/cli.ts @@ -130,7 +130,7 @@ cli `[boolean] force empty outDir when it's outside of root` ) .option('-m, --mode ', `[string] set env mode`) - .option('--watch', `[boolean] rebuilds when modules have changed on disk`) + .option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`) .action(async (root: string, options: BuildOptions & GlobalCLIOptions) => { const { build } = await import('./build') const buildOptions = cleanOptions(options) as BuildOptions