diff --git a/packages/webpack-cli/lib/groups/ConfigGroup.js b/packages/webpack-cli/lib/groups/ConfigGroup.js index 93920dddaeb..ed22885fce9 100644 --- a/packages/webpack-cli/lib/groups/ConfigGroup.js +++ b/packages/webpack-cli/lib/groups/ConfigGroup.js @@ -127,11 +127,6 @@ class ConfigGroup extends GroupHelper { newOptionsObject['options'] = configOptions; } - //warn the user if bail and watch both are used together - if (configOptions.bail && configOptions.watch) { - logger.warn('You are using "bail" with "watch". "bail" will still exit webpack when the first error is found.'); - } - if (configOptions && configPath.includes('.webpack')) { const currentPath = configPath; const parentContext = dirname(currentPath).split(sep).slice(0, -1).join(sep); diff --git a/packages/webpack-cli/lib/utils/Compiler.js b/packages/webpack-cli/lib/utils/Compiler.js index 4a2c4686e96..02176653d2c 100644 --- a/packages/webpack-cli/lib/utils/Compiler.js +++ b/packages/webpack-cli/lib/utils/Compiler.js @@ -118,7 +118,7 @@ class Compiler { } //warn the user if bail and watch both are used together - if (this.compiler.options.bail && outputOptions.watch) { + if (this.compiler.options.bail && (outputOptions.watch || options.watch)) { logger.warn('You are using "bail" with "watch". "bail" will still exit webpack when the first error is found.'); }