File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,13 +74,18 @@ const watchPatternLabFiles = (
7474 _ . each ( patternWatches , patternWatchPath => {
7575 logger . debug ( `Pattern Lab is watching ${ patternWatchPath } for changes` ) ;
7676
77+ if ( patternlab . watchers [ patternWatchPath ] ) {
78+ patternlab . watchers [ patternWatchPath ] . close ( ) ;
79+ }
80+
7781 const patternWatcher = chokidar . watch ( path . resolve ( patternWatchPath ) , {
7882 ignored : / ( ^ | [ \/ \\ ] ) \. ./ ,
7983 ignoreInitial : true ,
8084 awaitWriteFinish : {
8185 stabilityThreshold : 200 ,
8286 pollInterval : 100 ,
8387 } ,
88+ persistent : ! watchOnce ,
8489 } ) ;
8590
8691 //watch for changes and rebuild
@@ -100,13 +105,16 @@ const watchPatternLabFiles = (
100105 file : p ,
101106 } ) ;
102107 } ) ;
108+
109+ patternlab . watchers [ patternWatchPath ] = patternWatcher ;
103110 } ) ;
104111
105112 logger . info (
106113 `Pattern Lab is watching for changes to files under ${
107114 assetDirectories . source . root
108115 } `
109116 ) ;
117+ return Promise . resolve ( ) ;
110118} ;
111119
112120module . exports = watchPatternLabFiles ;
You can’t perform that action at this time.
0 commit comments