W
W
wakenbyWork2021-09-18 12:42:32
gulp.js
wakenbyWork, 2021-09-18 12:42:32

Did I overdo it with gulp-plumber?

In general, I configured plumber like this:

const plumber = require('gulp-plumber')
const notify = require('gulp-notify')
const chalk = require('chalk')

module.exports = function plumberSmart() {
  return plumber({
    errorHandler(error) {
      const message = error.message

      notify.onError({
        title: 'Gulp - ошибка компиляции',
        message: 'Откройте терминал для просмотра ошибки',
        sound: 'Beep'
      })(error)

      console.log(
        chalk.red(message)
      )

      this.emit('end')
    }
  })
}


Thanks to this, when an error occurs, for example, in scss, the watcher behind the files does not fall, and there is no need to restart gulp. So there is still a notification so as not to miss the error.

But after reviewing the popular repositories with configured gulp, no one does this. And I don't understand why. (Popular types are easy to find in the search, well, there are asterisks there)

The suspicion crept in that he did something that was not necessary))

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question