File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -29,13 +29,24 @@ const watchAssets = (
29
29
watchOnce
30
30
) => {
31
31
const assetBase = path . resolve ( basePath , dir . source ) ;
32
+ const assetsToIgnore = patternlab . config . transformedAssetTypes
33
+ ? patternlab . config . transformedAssetTypes . join ( '|' )
34
+ : '' ;
32
35
logger . debug ( `Pattern Lab is watching ${ assetBase } for changes` ) ;
33
36
34
37
if ( patternlab . watchers [ key ] ) {
35
38
patternlab . watchers [ key ] . close ( ) ;
36
39
}
37
40
const assetWatcher = chokidar . watch ( assetBase , {
38
- ignored : / ( ^ | [ \/ \\ ] ) \. ./ ,
41
+ // *ignored* combines file types that the wrapper is watching, passed to pl config
42
+ // regex string escapes backslashes for JS
43
+ // second part of regex is holdover from existing ignore regex for '/index.html' and other
44
+ // files meant to be ignored, not based on file type
45
+ ignored : new RegExp (
46
+ `(?:(?:.*\\.(?:${ assetsToIgnore } )$)|(?:(^|[\\/\\\\])\\..))` ,
47
+ 'i'
48
+ ) ,
49
+ // ignored: /(^|[\/\\])\../, //old version
39
50
ignoreInitial : false ,
40
51
awaitWriteFinish : {
41
52
stabilityThreshold : 200 ,
You can’t perform that action at this time.
0 commit comments