Skip to content

Commit 297707d

Browse files
committed
added --watch-poll
fixed webpack/watchpack#3
1 parent 0576143 commit 297707d

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

bin/config-optimist.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ module.exports = function(optimist) {
4949

5050
.boolean("watch").alias("watch", "w").describe("watch")
5151

52+
.describe("watch-aggregate-timeout")
53+
54+
.describe("watch-poll")
55+
5256
.boolean("hot").alias("hot", "h").describe("hot")
5357

5458
.boolean("debug").describe("debug")

bin/convert-argv.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,17 @@ module.exports = function(optimist, argv, convertOptions) {
8888
options.watch.aggregateTimeout = +argv["watch-delay"];
8989
}
9090

91-
if(argv["watch-aggregateTimeout"]) {
91+
if(argv["watch-aggregate-timeout"]) {
9292
options.watch = options.watch || {};
93-
options.watch.aggregateTimeout = +argv["watch-aggregateTimeout"];
93+
options.watch.aggregateTimeout = +argv["watch-aggregate-timeout"];
94+
}
95+
96+
if(argv["watch-poll"]) {
97+
options.watch = options.watch || {};
98+
if(typeof argv["watch-poll"] !== "boolean")
99+
options.watch.poll = +argv["watch-poll"];
100+
else
101+
options.watch.poll = true;
94102
}
95103

96104
function processOptions(options) {

0 commit comments

Comments
 (0)