parallel-webpack icon indicating copy to clipboard operation
parallel-webpack copied to clipboard

Add --silent option

Open marcofugaro opened this issue 5 years ago • 0 comments

Explain the problem

In my webpack.config.js, I have implemented my own logging system, where I log to the console when a bundle has started building, and when it has finished.

This results in double the logging: Screenshot 2020-09-15 at 12 27 27

I would like to disable the loggings of parallel-webpack.

Expected Behaviour

With --silent option nothing should be outputted.

Provide your webpack config

I am using the event-hooks-webpack-plugin

    plugins: [
      new EventHooksPlugin({
        compile() {
          console.log()
          console.log('⏳  Compiling...')
        },
        done(stats) {
          if (stats.hasErrors()) {
            const statsJson = stats.toJson({ all: false, warnings: true, errors: true })
            const messages = formatWebpackMessages(statsJson)
            console.log()
            console.log(chalk.red('❌  Failed to compile.'))
            console.log()
            console.log(messages.errors[0])
            return
          }

          const time = prettyMs(stats.endTime - stats.startTime)
          console.log()
          console.log(chalk.green(`✅  Compiled successfully in ${chalk.cyan(time)}`))
        },
      }),
    ],

Provide your Environment details

  • Node version: 14.5.0

  • Operating System: macOS Catalina

  • webpack version: 4.44.2

  • parallel-webpack version: 2.6.0

marcofugaro avatar Sep 21 '20 08:09 marcofugaro