File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -47,8 +47,11 @@ app.use(webpackMiddleware(webpack({
47
47
// switch into lazy mode
48
48
// that means no watching, but recompilation on every request
49
49
50
- watchDelay: 300 ,
51
- // delay after change (only lazy: false)
50
+ watchOptions: {
51
+ aggregateTimeout: 300 ,
52
+ poll: true
53
+ },
54
+ // watch options (only lazy: false)
52
55
53
56
publicPath: " /assets/" ,
54
57
// public path to bind the middleware to
Original file line number Diff line number Diff line change @@ -9,7 +9,13 @@ var mime = require("mime");
9
9
// constructor for the middleware
10
10
module . exports = function ( compiler , options ) {
11
11
if ( ! options ) options = { } ;
12
- if ( options . watchDelay === undefined ) options . watchDelay = 200 ;
12
+ if ( typeof options . watchOptions === "undefined" ) options . watchOptions = { } ;
13
+ if ( typeof options . watchDelay !== "undefined" ) {
14
+ // TODO remove this in next major version
15
+ console . warn ( "options.watchDelay is deprecated: Use 'options.watchOptions.aggregateTimeout' instead" ) ;
16
+ options . watchOptions . aggregateTimeout = options . watchDelay ;
17
+ }
18
+ if ( typeof options . watchOptions . aggregateTimeout === "undefined" ) options . watchOptions . aggregateTimeout = 200 ;
13
19
if ( typeof options . stats === "undefined" ) options . stats = { } ;
14
20
if ( ! options . stats . context ) options . stats . context = process . cwd ( ) ;
15
21
if ( options . lazy ) {
@@ -94,7 +100,7 @@ module.exports = function(compiler, options) {
94
100
95
101
// start watching
96
102
if ( ! options . lazy ) {
97
- var watching = compiler . watch ( options . watchDelay , function ( err ) {
103
+ var watching = compiler . watch ( options . watchOptions , function ( err ) {
98
104
if ( err ) throw err ;
99
105
} ) ;
100
106
} else {
You can’t perform that action at this time.
0 commit comments