-
Notifications
You must be signed in to change notification settings - Fork 161
Errors are not shown with gulp + webpack-stream #296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Maybe this will help you: webpack-stream didn't cut it for us for multiple reasons, including what you're talking about. Eventually, I wrote our own script to run webpack through gulp, like this: gulp.task('build-webpack', done => {
webpackAsync('webpack.config.js', done);
}); function webpackAsync (config, entry, callback) {
config = require(path.join(configsLocation, config));
webpack(config, (error, stats) => {
if (hasErrors(stats)) {
// Break Gulp execution:
process.exit(1);
// Or return the error to Gulp (you can choose)
// if (typeof callback === 'function') {
// callback(new Error('Webpack error (see above).');
// }
} else if (typeof callback === 'function') {
callback();
}
});
} * We have multiple builds, hence |
I’ll try this. Thanks. |
You mean like so? gulp.task('build-webpack', () => {
return webpackAsync('webpack.config.js'); // (considering webpackAsync return a promise of course)
}); |
Yes, that way you don’t need done argument. |
What do you mean will make build faster? |
Asynchronous operation allows other IO operation to be done at the same time. |
@stereokai Do you know how to make multiple output directories using your method ? gulp.src("*")
.pipe(webpackStream(require(webpackConfig), webpack))
.pipe(gulp.dest("out1"))
.pipe(gulp.dest("out2")) I can do manually build + copy, but using gulp.dest is much nicer. |
If I run webpack with HardSourcePlugin through gulp using webpack-stream ( https://github.com/shama/webpack-stream) , I don't see any errors.
Just build failure.
Without HardSourcePlugin the errors are displayed properly.
The text was updated successfully, but these errors were encountered: