Skip to content

Commit

Permalink
fix(readfile): resolve relative path before require
Browse files Browse the repository at this point in the history
Close #183.
  • Loading branch information
zypA13510 authored Sep 6, 2019
1 parent e5f90e3 commit 5b2aa3b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/readfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ module.exports = function(file) {

// JS / JSON / CoffeeScript
if (ext.match(/json|js|coffee|ls/)) {
if (!path.isAbsolute(file)) {
file = path.join(process.cwd(), file)
}
return require(file);
}

Expand Down

0 comments on commit 5b2aa3b

Please sign in to comment.