mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
parent
f56a2c6785
commit
94fff623f1
@ -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__ || [], process.cwd())
|
||||
paths: [].concat(global.__NUXT_PREPATHS__ || [], paths || [], this.options.modulesDir, global.__NUXT_PATHS__ || [], process.cwd())
|
||||
})
|
||||
} catch (error) {
|
||||
if (error.code !== 'MODULE_NOT_FOUND') {
|
||||
|
@ -77,7 +77,7 @@ export function resolveModule (id, paths) {
|
||||
paths = [paths]
|
||||
}
|
||||
return _require.resolve(id, {
|
||||
paths: [].concat(paths || [], global.__NUXT_PATHS__ || [], process.cwd())
|
||||
paths: [].concat(...(global.__NUXT_PREPATHS__ || []), paths || [], global.__NUXT_PATHS__ || [], process.cwd())
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -227,6 +227,7 @@ export default class WebpackBaseConfig {
|
||||
const webpackModulesDir = ['node_modules'].concat(this.buildContext.options.modulesDir)
|
||||
|
||||
const resolvePath = [
|
||||
...(global.__NUXT_PREPATHS__ || []),
|
||||
this.buildContext.options.rootDir,
|
||||
__dirname,
|
||||
...(global.__NUXT_PATHS__ || []),
|
||||
|
Loading…
Reference in New Issue
Block a user