diff --git a/examples/normal/package.json b/examples/normal/package.json index 600b68c6..90ba4c3b 100644 --- a/examples/normal/package.json +++ b/examples/normal/package.json @@ -3,6 +3,7 @@ "build": "father build", "build:no-clean": "father build --no-clean", "dev": "father dev", + "dev:no-clean": "father dev --no-clean", "doctor": "father doctor", "version": "father version" }, diff --git a/src/commands/dev.ts b/src/commands/dev.ts index 469bf5c3..bdd680e5 100644 --- a/src/commands/dev.ts +++ b/src/commands/dev.ts @@ -7,12 +7,16 @@ export default (api: IApi) => { api.registerCommand({ name: DEV_COMMAND, description: 'start incremental build in watch mode', - async fn() { + options: ` +--no-clean do not clean all output directories before dev +`, + async fn({ args }) { const buildWatcher = await builder({ userConfig: api.config, cwd: api.cwd, pkg: api.pkg, watch: true, + clean: args.clean, }); // handle config change