-
Notifications
You must be signed in to change notification settings - Fork 120
Open
Description
The running of gulp build corresponding to below setup
const gulp = require("gulp");
const gulpWebpack = require('webpack-stream');
const webpackConfig = {
watch: true,
mode: "production"
};
gulp.task("webpack", function() {
return gulp.src("Source/EntryPoint.js").
pipe(
gulpWebpack(
{ config: webpackConfig },
null,
(error, statistics) => {
if (error) {
console.error(error);
}
if (statistics) {
process.stdout.write(`${ statistics.toString({ colors: true }) }\n`);
}
}
)
).
pipe(gulp.dest("Output/"));
});
gulp.task("build", gulp.series("webpack"));causes the following warning:
(node:41540) [DEP_WEBPACK_WATCH_WITHOUT_CALLBACK] DeprecationWarning: A 'callback' argument needs to be provided to the 'webpack(options, callback)' function when the 'watch' option is set. There is no way to handle the 'watch' option without a callback.
and the execution stops after first build. If we'll replace the multicompilation with single compilation:
const gulp = require("gulp");
const gulpWebpack = require('webpack-stream');
gulp.task("webpack", function() {
return gulp.src("Source/EntryPoint.js").
pipe(
gulpWebpack(
{
watch: true,
mode: "production"
},
null,
(error, statistics) => {
if (error) {
console.error(error);
}
if (statistics) {
process.stdout.write(`${ statistics.toString({ colors: true }) }\n`);
}
}
)
).
pipe(gulp.dest("Output/"));
});everything will work fine.
If it is the bug, would you please to fix it?
I have pasted the reproduction.
Metadata
Metadata
Assignees
Labels
No labels