Skip to content

Commit

Permalink
Merge pull request #72 from orkaplan/hotfix/require_resolve_node12_3_0
Browse files Browse the repository at this point in the history
Since node 12.3.0 require.resolve requires options.paths to be a list
  • Loading branch information
detrohutt authored Dec 18, 2019
2 parents c904838 + d855109 commit 6ec86b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default ({ types: t, template }) => ({
// Find the file, using node resolution/NODE_PATH if necessary.
const fallbackPaths = opts.nodePath
? opts.nodePath.split(delimiter)
: process.env.NODE_PATH
: [process.env.NODE_PATH]
let absPath = resolve(importPath, jsFilename)
if (!existsSync(absPath)) absPath = require.resolve(importPath, { paths: fallbackPaths })

Expand Down

0 comments on commit 6ec86b8

Please sign in to comment.