File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -145,21 +145,24 @@ class GlobFilesTracker {
145
145
}
146
146
147
147
regenerate ( ) {
148
- let watchIgnoreFlat = [ ] ;
148
+ const watchIgnoreSet = new Set ( ) ;
149
149
for ( const pattern of this . watchIgnore ) {
150
- watchIgnoreFlat = watchIgnoreFlat . concat ( glob . sync ( pattern , { dot : true } ) ) ;
150
+ glob . sync ( pattern , { dot : true } ) . forEach ( filePath => watchIgnoreSet . add ( filePath ) ) ;
151
151
}
152
152
153
+ const globOpts = {
154
+ dot : true ,
155
+ ignore : {
156
+ ignored : ( ) => false ,
157
+ childrenIgnored : pathToCheck => watchIgnoreSet . has ( pathToCheck . relative ( ) )
158
+ }
159
+ } ;
160
+
153
161
this . watchFilesSet . clear ( ) ;
154
162
for ( const pattern of this . watchFiles ) {
155
- glob . sync ( pattern , { dot : true } ) . forEach ( pathToCheck => {
156
- for ( const watchIgnore of watchIgnoreFlat ) {
157
- if ( pathToCheck === watchIgnore ) {
158
- return ;
159
- }
160
- if ( pathToCheck . startsWith ( watchIgnore + path . sep ) ) {
161
- return ;
162
- }
163
+ glob . sync ( pattern , globOpts ) . forEach ( pathToCheck => {
164
+ if ( watchIgnoreSet . has ( pathToCheck ) ) {
165
+ return ;
163
166
}
164
167
this . watchFilesSet . add ( pathToCheck ) ;
165
168
} ) ;
You can’t perform that action at this time.
0 commit comments