File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ module.exports = function(folder) {
77 let rootFolder = folder
88 if ( folder . charAt ( folder . length - path . sep . length ) !== path . sep ) {
99 debug ( 'Testing if the folder is a folder' )
10- rootFolder = path . dirname ( folder )
10+ rootFolder = path . dirname ( folder ) . replace ( new RegExp ( '\\' + path . sep , 'g' ) , '/' )
1111 }
1212 var watcher = chokidar . watch ( rootFolder )
1313 var re = new RegExp ( rootFolder )
@@ -16,7 +16,7 @@ module.exports = function(folder) {
1616 watcher . on ( 'all' , function ( ) {
1717 console . log ( 'Clearing ' + rootFolder + ' module cache from server' )
1818 Object . keys ( require . cache ) . forEach ( function ( id ) {
19- if ( re . test ( id ) ) {
19+ if ( re . test ( id . replace ( new RegExp ( '\\' + path . sep , 'g' ) , '/' ) ) ) {
2020 debug ( 'deleting cache key' )
2121 delete require . cache [ id ]
2222 }
You can’t perform that action at this time.
0 commit comments