Skip to content

Commit ae76261

Browse files
committed
🐛 Fix watch option recognition with multiple compilers
1 parent ee3a0bc commit ae76261

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/webpack.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ function webpack(options, callback) {
2828
}
2929
if(callback) {
3030
if(typeof callback !== "function") throw new Error("Invalid argument: callback");
31-
if(options.watch === true) {
31+
if(options.watch === true || (Array.isArray(options) &&
32+
options.some(function(o) {
33+
return o.watch;
34+
}))) {
3235
var watchOptions = (!Array.isArray(options) ? options : options[0]).watchOptions || {};
3336
return compiler.watch(watchOptions, callback);
3437
}

0 commit comments

Comments
 (0)