File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,13 +29,24 @@ const watchAssets = (
2929 watchOnce
3030) => {
3131 const assetBase = path . resolve ( basePath , dir . source ) ;
32+ const assetsToIgnore = patternlab . config . transformedAssetTypes
33+ ? patternlab . config . transformedAssetTypes . join ( '|' )
34+ : '' ;
3235 logger . debug ( `Pattern Lab is watching ${ assetBase } for changes` ) ;
3336
3437 if ( patternlab . watchers [ key ] ) {
3538 patternlab . watchers [ key ] . close ( ) ;
3639 }
3740 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
3950 ignoreInitial : false ,
4051 awaitWriteFinish : {
4152 stabilityThreshold : 200 ,
You can’t perform that action at this time.
0 commit comments