Skip to content

How to make the whole gulp abort when webpack has an error? #104

Closed
@pksjce

Description

@pksjce

From @binarykitchen on February 17, 2015 21:11

Hello guys

I have the gulp (pseudo)code below. But when an error occurs, i.E. a module couldn't be found due to a wrong path, then the error is shown on gulp BUT the gulp task continues.

What change is required to make the gulp task stop?

Thanks!

var webpackCompiler = webpack({
     ...
  },
  plugins: _.compact([
    ...
});

gulp.task('webpack', function(cb) {
  return webpackCompiler.run(function(err, stats) {
    if (err) {
      throw new gutil.PluginError('webpack', err);
    }
    gutil.log("[webpack]", stats.toString({
      ...
    }));
    return cb();
  });
});

Copied from original issue: webpack/webpack#797

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions