Skip to content

Commit ac87924

Browse files
authored
fix: Add only directories in a glob root config (#120)
1 parent a8e2689 commit ac87924

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import path from 'path';
2+
import fs from 'fs';
23
import glob from 'glob';
34
import findBabelConfig from 'find-babel-config';
45
import getRealPath from './getRealPath';
@@ -28,7 +29,9 @@ export function manipulatePluginOptions(pluginOpts) {
2829
// eslint-disable-next-line no-param-reassign
2930
pluginOpts.root = pluginOpts.root.reduce((resolvedDirs, dirPath) => {
3031
if (glob.hasMagic(dirPath)) {
31-
return resolvedDirs.concat(glob.sync(dirPath));
32+
return resolvedDirs.concat(
33+
glob.sync(dirPath).filter(p => fs.lstatSync(p).isDirectory()),
34+
);
3235
}
3336
return resolvedDirs.concat(dirPath);
3437
}, []);

0 commit comments

Comments
 (0)