Skip to content

Commit

Permalink
fix: use different name than __require (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd authored Dec 4, 2023
1 parent 13b09d0 commit b619a08
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/req.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ let jiti = null
* @returns {Promise<any>}
*/
async function req(name, rootFile = __filename) {
let __require = createRequire(rootFile)
let url = __require.resolve(name)
let url = createRequire(rootFile).resolve(name)

try {
return (await import(pathToFileURL(url).href)).default
Expand Down

0 comments on commit b619a08

Please sign in to comment.