diff --git a/actions/build.action.ts b/actions/build.action.ts index 39c85b2f0..cd2728d9b 100644 --- a/actions/build.action.ts +++ b/actions/build.action.ts @@ -186,7 +186,9 @@ export class BuildAction extends AbstractAction { watchMode: boolean, onSuccess: (() => void) | undefined, ) { - const { WebpackCompiler } = await import('../lib/compiler/webpack-compiler') + const { WebpackCompiler } = await import( + '../lib/compiler/webpack-compiler' + ); const webpackCompiler = new WebpackCompiler(this.pluginsLoader); const webpackPath = diff --git a/commands/build.command.ts b/commands/build.command.ts index cd40aab75..1e3f03f18 100644 --- a/commands/build.command.ts +++ b/commands/build.command.ts @@ -18,7 +18,11 @@ export class BuildCommand extends AbstractCommand { ) .option('--type-check', 'Enable type checking (when SWC is used).') .option('--webpackPath [path]', 'Path to webpack configuration.') - .option('--tsc', 'Use tsc for compilation.') + .option('--tsc', 'Use typescript compiler for compilation.') + .option( + '--preserveWatchOutput', + 'Use "preserveWatchOutput" option when using tsc watch mode.', + ) .description('Build Nest application.') .action(async (app: string, command: Command) => { const options: Input[] = []; @@ -67,6 +71,14 @@ export class BuildCommand extends AbstractCommand { value: command.typeCheck, }); + options.push({ + name: 'preserveWatchOutput', + value: + !!command.preserveWatchOutput && + !!command.watch && + !isWebpackEnabled, + }); + const inputs: Input[] = []; inputs.push({ name: 'app', value: app }); await this.action.handle(inputs, options); diff --git a/commands/start.command.ts b/commands/start.command.ts index dd907e2d1..1e0b17ef9 100644 --- a/commands/start.command.ts +++ b/commands/start.command.ts @@ -23,7 +23,7 @@ export class StartCommand extends AbstractCommand { ) .option('--webpackPath [path]', 'Path to webpack configuration.') .option('--type-check', 'Enable type checking (when SWC is used).') - .option('--tsc', 'Use tsc for compilation.') + .option('--tsc', 'Use typescript compiler for compilation.') .option( '--sourceRoot [sourceRoot]', 'Points at the root of the source code for the single project in standard mode structures, or the default project in monorepo mode structures.', @@ -35,7 +35,7 @@ export class StartCommand extends AbstractCommand { .option('-e, --exec [binary]', 'Binary to run (default: "node").') .option( '--preserveWatchOutput', - 'Use "preserveWatchOutput" option when tsc watch mode.', + 'Use "preserveWatchOutput" option when using tsc watch mode.', ) .description('Run Nest application.') .action(async (app: string, command: Command) => { diff --git a/lib/schematics/abstract.collection.ts b/lib/schematics/abstract.collection.ts index 88a25a85e..bf268583d 100644 --- a/lib/schematics/abstract.collection.ts +++ b/lib/schematics/abstract.collection.ts @@ -3,7 +3,10 @@ import { Schematic } from './nest.collection'; import { SchematicOption } from './schematic.option'; export abstract class AbstractCollection { - constructor(protected collection: string, protected runner: AbstractRunner) {} + constructor( + protected collection: string, + protected runner: AbstractRunner, + ) {} public async execute( name: string,