Skip to content

Commit

Permalink
Fix(config): remove hasMagic
Browse files Browse the repository at this point in the history
  • Loading branch information
elevatebart authored and Barthelemy Ledoux committed Sep 11, 2018
1 parent 5263b27 commit 1c44a84
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions loaders/utils/getComponentFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,12 @@ const getComponentGlobs = components => {

const getFilesMatchingGlobs = (components, rootDir, ignore) =>
components
.map(listItem => {
// Check if the string looks like a glob pattern by using hasMagic
if (glob.hasMagic(listItem)) {
return glob.sync(listItem, {
cwd: rootDir,
ignore,
// in order to avoid detecting each component twice on windows
// when matching 2 cases of the same word, like {Src,src}
// we remove case-sensitivity on windows
nocase: process.platform === 'win32',
});
}
// Wrap path in an array so reduce always gets an array of arrays
return [listItem];
})
.map(listItem =>
glob.sync(path.resolve(rootDir, listItem), {
cwd: rootDir,
ignore,
})
)
.reduce((accumulator, current) => accumulator.concat(current), []);

/**
Expand Down

0 comments on commit 1c44a84

Please sign in to comment.