Skip to content

Commit

Permalink
Merge pull request #104 from testdouble/check-compat-without-version
Browse files Browse the repository at this point in the history
Don't use Node.js version number to determine loader capabilities
  • Loading branch information
giltayar authored Nov 12, 2023
2 parents c7b96e1 + 9c6b400 commit 9ddcf00
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 18 deletions.
4 changes: 2 additions & 2 deletions example-esm/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions lib/canRegisterLoader.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
function canRegisterLoader () {
const [major, minor] = process.versions.node
.split('.')
.map((m) => parseInt(m, 10))
const Module = require('module')

return major > 20 || (major === 20 && minor >= 6)
function canRegisterLoader () {
return !!Module.register
}

exports.canRegisterLoader = canRegisterLoader
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"dependencies": {
"lodash": "^4.17.21",
"resolve": "^1.22.4"
"resolve": "^1.22.8"
},
"devDependencies": {
"core-assert": "^1.0.0",
Expand Down

0 comments on commit 9ddcf00

Please sign in to comment.