diff options
Diffstat (limited to 'deps/npm/node_modules/resolve/lib/sync.js')
-rw-r--r-- | deps/npm/node_modules/resolve/lib/sync.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/deps/npm/node_modules/resolve/lib/sync.js b/deps/npm/node_modules/resolve/lib/sync.js index da74e19d0c..d5308c926e 100644 --- a/deps/npm/node_modules/resolve/lib/sync.js +++ b/deps/npm/node_modules/resolve/lib/sync.js @@ -1,9 +1,9 @@ -var isCore = require('./is-core'); +var isCore = require('is-core-module'); var fs = require('fs'); var path = require('path'); -var caller = require('./caller.js'); -var nodeModulesPaths = require('./node-modules-paths.js'); -var normalizeOptions = require('./normalize-options.js'); +var caller = require('./caller'); +var nodeModulesPaths = require('./node-modules-paths'); +var normalizeOptions = require('./normalize-options'); var realpathFS = fs.realpathSync && typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync; @@ -66,6 +66,7 @@ module.exports = function resolveSync(x, options) { var packageIterator = opts.packageIterator; var extensions = opts.extensions || ['.js']; + var includeCoreModules = opts.includeCoreModules !== false; var basedir = opts.basedir || path.dirname(caller()); var parent = opts.filename || basedir; @@ -79,7 +80,7 @@ module.exports = function resolveSync(x, options) { if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/'; var m = loadAsFileSync(res) || loadAsDirectorySync(res); if (m) return maybeRealpathSync(realpathSync, m, opts); - } else if (isCore(x)) { + } else if (includeCoreModules && isCore(x)) { return x; } else { var n = loadNodeModulesSync(x, absoluteStart); |