diff --git a/index.js b/index.js index 30a746b..29c7117 100644 --- a/index.js +++ b/index.js @@ -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});