-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Require.resolve fallback on node < 8.10.0 #1404
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😉
@@ -0,0 +1,5 @@ | |||
exports.minNode = function (major, minor = 0, patch = 0) { | |||
const parts = process.versions.node.split('.').map(v => parseInt(v)) | |||
if (parts[0] >= major && parts[1] >= minor && parts[2] >= patch) return true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could return whole expression
@@ -0,0 +1,5 @@ | |||
exports.minNode = function (major, minor = 0, patch = 0) { | |||
const parts = process.versions.node.split('.').map(v => parseInt(v)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could use destructuring and give part names like const [major,minor,patch] = ...
i’m aware these are already taken, just suggesting.
packages/@vue/cli/lib/util/module.js
Outdated
} | ||
} | ||
|
||
var filename = Module._findPath(request, paths, isMain) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this var while others are const?
packages/@vue/cli/lib/util/module.js
Outdated
|
||
var filename = Module._findPath(request, paths, isMain) | ||
if (!filename) { | ||
var err = new Error(`Cannot find module '${request}'`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
@zigomir Thanks! ^.^ |
Fix #1396