File tree 1 file changed +15
-3
lines changed
1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,19 @@ const getFilterSync = options => options && options.gitignore
96
96
? isGitIgnoredSync ( { cwd : options . cwd , ignore : options . ignore } )
97
97
: DEFAULT_FILTER ;
98
98
99
- const globToTask = task => glob => {
99
+ const globToTask = task => async glob => {
100
+ const { options} = task ;
101
+ if ( options . ignore && Array . isArray ( options . ignore ) && options . expandDirectories ) {
102
+ options . ignore = await dirGlob ( options . ignore ) ;
103
+ }
104
+
105
+ return {
106
+ pattern : glob ,
107
+ options,
108
+ } ;
109
+ } ;
110
+
111
+ const globToTaskSync = task => glob => {
100
112
const { options} = task ;
101
113
if ( options . ignore && Array . isArray ( options . ignore ) && options . expandDirectories ) {
102
114
options . ignore = dirGlob . sync ( options . ignore ) ;
@@ -135,7 +147,7 @@ export const globbySync = (patterns, options) => {
135
147
136
148
const tasks = [ ] ;
137
149
for ( const task of globTasks ) {
138
- const newTask = getPattern ( task , dirGlob . sync ) . map ( globToTask ( task ) ) ;
150
+ const newTask = getPattern ( task , dirGlob . sync ) . map ( globToTaskSync ( task ) ) ;
139
151
tasks . push ( ...newTask ) ;
140
152
}
141
153
@@ -154,7 +166,7 @@ export const globbyStream = (patterns, options) => {
154
166
155
167
const tasks = [ ] ;
156
168
for ( const task of globTasks ) {
157
- const newTask = getPattern ( task , dirGlob . sync ) . map ( globToTask ( task ) ) ;
169
+ const newTask = getPattern ( task , dirGlob . sync ) . map ( globToTaskSync ( task ) ) ;
158
170
tasks . push ( ...newTask ) ;
159
171
}
160
172
You can’t perform that action at this time.
0 commit comments