Skip to content

Commit

Permalink
Support globs inside a node module folder - devongovett#1
Browse files Browse the repository at this point in the history
  • Loading branch information
markhicken committed Mar 22, 2019
1 parent b5dd73f commit 8163b6f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ module.exports = function ({types: t}) {
}

let files = glob.sync(pattern, {strict: true, nodir: true});
if (files.length === 0) {
pattern = 'node_modules/' + path.node.source.value;
files = glob.sync(pattern, {strict: true, nodir: true});
}

// Capture matches
let re = micromatch.makeRe(pattern, {capture: true});
Expand Down

0 comments on commit 8163b6f

Please sign in to comment.