diff --git a/packages/webpack-cli/lib/utils/logger.js b/packages/webpack-cli/lib/utils/logger.js index 9d431feeaff..cf686010894 100644 --- a/packages/webpack-cli/lib/utils/logger.js +++ b/packages/webpack-cli/lib/utils/logger.js @@ -1,3 +1,8 @@ -const { getLogger } = require('webpack/lib/logging/runtime'); +const { red, cyan, yellow } = require('colorette'); -module.exports = getLogger('webpack-cli'); +module.exports = { + error: (val, arg) => console.error(red(val), arg), + warn: (val, arg) => console.warn(yellow(val), arg), + info: (val, arg) => console.info(cyan(val), arg), + log: (val, arg) => console.log(val, arg), +}; diff --git a/test/hot/hot-flag.test.js b/test/hot/hot-flag.test.js index 59550f322a6..88744da704f 100644 --- a/test/hot/hot-flag.test.js +++ b/test/hot/hot-flag.test.js @@ -19,7 +19,7 @@ describe('--hot flag', () => { it('should warn when --hot and --no-hot both are passed', (done) => { const { stderr, stdout } = run(__dirname, ['--no-hot', '--hot']); expect(stderr).toContain( - '[webpack-cli] You provided both --hot and --no-hot. We will use only the last of these flags that you provided in your CLI arguments', + 'You provided both --hot and --no-hot. We will use only the last of these flags that you provided in your CLI arguments', ); expect(stdout).toContain('HotModuleReplacementPlugin'); diff --git a/test/no-hot/no-hot.test.js b/test/no-hot/no-hot.test.js index 5120de11cd2..7ef3db73bf1 100644 --- a/test/no-hot/no-hot.test.js +++ b/test/no-hot/no-hot.test.js @@ -25,7 +25,7 @@ describe('no-hot flag', () => { it('should warn when --hot and --no-hot both are passed', (done) => { const { stderr, stdout } = run(__dirname, ['--hot', '--no-hot']); expect(stderr).toContain( - '[webpack-cli] You provided both --hot and --no-hot. We will use only the last of these flags that you provided in your CLI arguments', + 'You provided both --hot and --no-hot. We will use only the last of these flags that you provided in your CLI arguments', ); expect(stdout).toBeTruthy();