Skip to content

Commit d39b4c4

Browse files
committed
Merge pull request webpack#2498 from jbarrus/webpack-1
🐛 Fix `watch` option recognition with multiple compilers
2 parents 326c817 + 141ebf0 commit d39b4c4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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
// TODO remove this in next major version
3437
var watchDelay = (!Array.isArray(options) ? options : options[0]).watchDelay;

0 commit comments

Comments
 (0)