Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions packages/webpack-cli/src/plugins/cli-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class CLIPlugin {

setupHelpfulOutput(compiler: Compiler) {
const pluginName = "webpack-cli";
const getCompilationName = () => (compiler.name ? `'${compiler.name}'` : "");
const getCompilationName = () => (compiler.name ? ` '${compiler.name}'` : "");
const logCompilation = (message: string) => {
if (process.env.WEBPACK_CLI_START_FINISH_FORCE_LOG) {
process.stderr.write(message);
Expand All @@ -84,13 +84,11 @@ export class CLIPlugin {
compiler.hooks.run.tap(pluginName, () => {
const name = getCompilationName();

logCompilation(`Compiler${name ? ` ${name}` : ""} starting... `);
logCompilation(`Compiler${name} starting... `);

if (configPath) {
this.logger.log(
`Compiler${name ? ` ${name}` : ""} is using config: ${configPath
.map((path) => `'${path}'`)
.join(", ")}`,
`Compiler${name} is using config: ${configPath.map((path) => `'${path}'`).join(", ")}`,
);
}
});
Expand All @@ -106,10 +104,10 @@ export class CLIPlugin {

const name = getCompilationName();

logCompilation(`Compiler${name ? ` ${name}` : ""} starting... `);
logCompilation(`Compiler${name} starting... `);

if (configPath) {
this.logger.log(`Compiler${name ? ` ${name}` : ""} is using config: '${configPath}'`);
this.logger.log(`Compiler${name} is using config: '${configPath}'`);
}
});

Expand All @@ -125,11 +123,11 @@ export class CLIPlugin {
() => {
const name = getCompilationName();

logCompilation(`Compiler${name ? ` ${name}` : ""} finished`);
logCompilation(`Compiler${name} finished`);

process.nextTick(() => {
if (compiler.watchMode) {
this.logger.log(`Compiler${name ? `${name}` : ""} is watching files for updates...`);
this.logger.log(`Compiler${name} is watching files for updates...`);
}
});
},
Expand Down
2 changes: 1 addition & 1 deletion packages/webpack-cli/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ type WebpackDevServerOptions = DevServerConfig &
Argv & {
nodeEnv?: string;
watchOptionsStdin?: boolean;
progress?: boolean | "profile" | undefined;
progress?: boolean | "profile";
analyze?: boolean;
prefetch?: string;
json?: boolean;
Expand Down