File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ module.exports = function(compiler, options) {
82
82
83
83
// start watching
84
84
if ( ! options . lazy ) {
85
- compiler . watch ( options . watchDelay , function ( err ) {
85
+ var watching = compiler . watch ( options . watchDelay , function ( err ) {
86
86
if ( err ) throw err ;
87
87
} ) ;
88
88
} else {
@@ -101,7 +101,7 @@ module.exports = function(compiler, options) {
101
101
}
102
102
103
103
// The middleware function
104
- return function webpackDevMiddleware ( req , res , next ) {
104
+ function webpackDevMiddleware ( req , res , next ) {
105
105
// publicPrefix ist the folder our bundle should be in
106
106
var localPrefix = options . publicPath || "/" ;
107
107
if ( / ^ h t t p s ? : \/ \/ / . test ( localPrefix ) ) {
@@ -137,4 +137,12 @@ module.exports = function(compiler, options) {
137
137
res . end ( content ) ;
138
138
} , req ) ;
139
139
}
140
+
141
+ webpackDevMiddleware . invalidate = function ( ) {
142
+ if ( watching ) watching . invalidate ( ) ;
143
+ } ;
144
+
145
+ webpackDevMiddleware . fileSystem = fs ;
146
+
147
+ return webpackDevMiddleware ;
140
148
}
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " webpack-dev-middleware" ,
3
- "version" : " 1.0.0 " ,
3
+ "version" : " 1.0.1 " ,
4
4
"author" : " Tobias Koppers @sokra" ,
5
5
"description" : " Offers a dev middleware for webpack, which arguments a live bundle to a directory" ,
6
6
"peerDependencies" : {
You can’t perform that action at this time.
0 commit comments