Skip to content

Commit 70b03bb

Browse files
committed
Ensure to resolve absolute path
1 parent e7143f6 commit 70b03bb

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/metascraper-clearbit-logo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
],
3939
"scripts": {
4040
"coveralls": "nyc report --reporter=text-lcov | coveralls",
41-
"test": "TZ=UTC NODE_ENV=test nyc mocha test"
41+
"test": "NODE_PATH=.. TZ=UTC NODE_ENV=test nyc mocha test"
4242
},
4343
"license": "MIT",
4444
"lint-staged": {

packages/metascraper/src/load-rules.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
'use strict'
22

3+
const path = require('path')
4+
35
const cwd = process.env.METASCRAPER_CONFIG_CWD || process.cwd()
46
const config = require('cosmiconfig')('metascraper').load(cwd)
7+
58
const {
69
findIndex,
710
forEach,
@@ -45,7 +48,8 @@ module.exports = () =>
4548
moduleConfig = rule[moduleName]
4649
}
4750

48-
return require(moduleName)(moduleConfig)
51+
const modulePath = path.resolve(cwd, 'node_modules', moduleName)
52+
return require(modulePath)(moduleConfig)
4953
})
5054
// merge rules with same props
5155
.reduce((acc, rules) => {

0 commit comments

Comments
 (0)