From 685df00aba0327fe76444a799aaae208ee7adb0f Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Sun, 20 Sep 2020 20:54:50 +0530 Subject: [PATCH] chore: add comments --- .../lib/utils/warnings/bailAndWatchWarning.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/webpack-cli/lib/utils/warnings/bailAndWatchWarning.js b/packages/webpack-cli/lib/utils/warnings/bailAndWatchWarning.js index 0acbe8cfd05..84894469cab 100644 --- a/packages/webpack-cli/lib/utils/warnings/bailAndWatchWarning.js +++ b/packages/webpack-cli/lib/utils/warnings/bailAndWatchWarning.js @@ -1,7 +1,14 @@ const logger = require('../logger'); -module.exports = (compiler) => { +/** + * warn the user if bail and watch both are used together + * @param {Object} webpack compiler + * @returns {void} + */ +const bailAndWatchWarning = (compiler) => { if (compiler.options.bail && compiler.options.watch) { logger.warn('You are using "bail" with "watch". "bail" will still exit webpack when the first error is found.'); } }; + +module.exports = bailAndWatchWarning;