Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add only directories in a glob root config #120

Merged
merged 1 commit into from
Feb 5, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import path from 'path';
import fs from 'fs';
import glob from 'glob';
import findBabelConfig from 'find-babel-config';
import getRealPath from './getRealPath';
Expand Down Expand Up @@ -28,7 +29,9 @@ export function manipulatePluginOptions(pluginOpts) {
// eslint-disable-next-line no-param-reassign
pluginOpts.root = pluginOpts.root.reduce((resolvedDirs, dirPath) => {
if (glob.hasMagic(dirPath)) {
return resolvedDirs.concat(glob.sync(dirPath));
return resolvedDirs.concat(
glob.sync(dirPath).filter(p => fs.lstatSync(p).isDirectory()),
);
}
return resolvedDirs.concat(dirPath);
}, []);
Expand Down