Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add flag to force start finish log #2566

Merged
merged 4 commits into from Mar 28, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 10 additions & 4 deletions packages/webpack-cli/lib/plugins/CLIPlugin.js
Expand Up @@ -45,8 +45,11 @@ class CLIPlugin {

compiler.hooks.run.tap(pluginName, () => {
const name = getCompilationName();

this.logger.log(`Compiler${name ? ` ${name}` : ''} starting...`);
if (process.env.WEBPACK_CLI_START_FINISH_FORCE_LOG_FORCE) {
process.stderr.write(`Compiler${name ? ` ${name}` : ''} starting...`);
} else {
this.logger.log(`Compiler${name ? ` ${name}` : ''} starting...`);
}

if (configPath) {
this.logger.log(`Compiler${name ? ` ${name}` : ''} is using config: '${configPath}'`);
Expand Down Expand Up @@ -78,8 +81,11 @@ class CLIPlugin {

(compiler.webpack ? compiler.hooks.afterDone : compiler.hooks.done).tap(pluginName, () => {
const name = getCompilationName();

this.logger.log(`Compiler${name ? ` ${name}` : ''} finished`);
if (process.env.WEBPACK_CLI_START_FINISH_FORCE_LOG_FORCE) {
process.stderr.write(`Compiler${name ? ` ${name}` : ''} finished`);
} else {
this.logger.log(`Compiler${name ? ` ${name}` : ''} finished`);
}

process.nextTick(() => {
if (compiler.watchMode) {
Expand Down