_fix: use pwd as last option for resolveModule

[release]
This commit is contained in:
Pooya Parsa 2020-12-23 00:36:15 +01:00
parent a31a878db5
commit 57c6f23a52
2 changed files with 2 additions and 2 deletions

View File

@ -28,7 +28,7 @@ export default class Resolver {
resolveModule (path, { paths } = {}) {
try {
return this._require.resolve(path, {
paths: [].concat(paths || [], this.options.modulesDir, global.__NUXT_PATHS__ || [])
paths: [].concat(paths || [], this.options.modulesDir, global.__NUXT_PATHS__ || [], process.cwd())
})
} catch (error) {
if (error.code !== 'MODULE_NOT_FOUND') {

View File

@ -68,7 +68,7 @@ export function resolveModule (id, paths) {
paths = [paths]
}
return _require.resolve(id, {
paths: [].concat(paths || [], global.__NUXT_PATHS__ || [])
paths: [].concat(paths || [], global.__NUXT_PATHS__ || [], process.cwd())
})
}