Skip to content

Commit

Permalink
filter directories out of glob patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
FredKSchott committed Aug 20, 2019
1 parent 9adf3f0 commit 0561f7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export async function install(
if (!glob.hasMagic(dep)) {
depList.add(dep);
} else {
glob.sync(dep, {cwd: nodeModulesLoc}).forEach(depList.add);
glob.sync(dep, {cwd: nodeModulesLoc, nodir: true}).forEach((f) => depList.add(f));

This comment has been minimized.

Copy link
@calebdwilliams

calebdwilliams Aug 23, 2019

Contributor

Is the idea here that using something like

"@pika/web": {
  "webDependencies": [
    "bootstrap/**/*.css"
  ]
}

would be disallowed? In practice this is causing issues for me with the plugin hanging up.

This comment has been minimized.

Copy link
@FredKSchott

FredKSchott Aug 23, 2019

Author Owner

This just tells the globber to only return files in the response: if you don't include a file extension at the end (bootstrap/css/**/*) it will match all files PLUS the directories themselves. nodir filters out directories so that you're only left matching actual files.

I considered it a bug fix, but if you're seeing something no longer work with this option lmk!

}
});
for (const filePath of PACKAGES_TO_AUTO_DETECT_EXPORTS) {
Expand Down

0 comments on commit 0561f7a

Please sign in to comment.