Skip to content

Commit

Permalink
Fix ESM in Node v18.19.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jsumners-nr committed Dec 11, 2023
1 parent 5845e21 commit 437823d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ const NODE_MINOR = Number(NODE_VERSION[1])

let entrypoint

if (NODE_MAJOR >= 20) {
let getExports
if (NODE_MAJOR >= 20 || (NODE_MAJOR == 18 && NODE_MINOR >= 19)) {
getExports = require('./lib/get-exports.js')
} else {
getExports = (url) => import(url).then(Object.keys)
Expand Down

0 comments on commit 437823d

Please sign in to comment.