File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -74,13 +74,18 @@ const watchPatternLabFiles = (
74
74
_ . each ( patternWatches , patternWatchPath => {
75
75
logger . debug ( `Pattern Lab is watching ${ patternWatchPath } for changes` ) ;
76
76
77
+ if ( patternlab . watchers [ patternWatchPath ] ) {
78
+ patternlab . watchers [ patternWatchPath ] . close ( ) ;
79
+ }
80
+
77
81
const patternWatcher = chokidar . watch ( path . resolve ( patternWatchPath ) , {
78
82
ignored : / ( ^ | [ \/ \\ ] ) \. ./ ,
79
83
ignoreInitial : true ,
80
84
awaitWriteFinish : {
81
85
stabilityThreshold : 200 ,
82
86
pollInterval : 100 ,
83
87
} ,
88
+ persistent : ! watchOnce ,
84
89
} ) ;
85
90
86
91
//watch for changes and rebuild
@@ -100,13 +105,16 @@ const watchPatternLabFiles = (
100
105
file : p ,
101
106
} ) ;
102
107
} ) ;
108
+
109
+ patternlab . watchers [ patternWatchPath ] = patternWatcher ;
103
110
} ) ;
104
111
105
112
logger . info (
106
113
`Pattern Lab is watching for changes to files under ${
107
114
assetDirectories . source . root
108
115
} `
109
116
) ;
117
+ return Promise . resolve ( ) ;
110
118
} ;
111
119
112
120
module . exports = watchPatternLabFiles ;
You can’t perform that action at this time.
0 commit comments