Skip to content

Commit

Permalink
fix: use fallback module resolve for Node version < 10
Browse files Browse the repository at this point in the history
The "paths" option for require.resolve does not work in certain
versions of 8.x and 9.x.

close #1486
  • Loading branch information
yyx990803 committed Jun 6, 2018
1 parent 5064cf5 commit 12d51fd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/@vue/cli/lib/util/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ function resolveFallback (request, options) {
return filename
}

const resolve = semver.satisfies(process.version, '>=8.10.0') ? require.resolve : resolveFallback
const resolve = semver.satisfies(process.version, '>=10.0.0')
? require.resolve
: resolveFallback

exports.resolveModule = function (request, context) {
let resolvedPath
Expand Down

0 comments on commit 12d51fd

Please sign in to comment.