mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
_fix(pnp): resolve module dependencies
This commit is contained in:
parent
5bd4fe08c6
commit
d3ef163004
@ -157,6 +157,8 @@ export default class ModuleContainer {
|
|||||||
if (!handler) {
|
if (!handler) {
|
||||||
try {
|
try {
|
||||||
handler = this.nuxt.resolver.requireModule(src, { paths })
|
handler = this.nuxt.resolver.requireModule(src, { paths })
|
||||||
|
// pnp support
|
||||||
|
try { (global.__NUXT_PATHS__ || []).push(this.nuxt.resolver.resolvePath(src, { paths })) } catch (_err) {}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.code !== 'MODULE_NOT_FOUND') {
|
if (error.code !== 'MODULE_NOT_FOUND') {
|
||||||
throw error
|
throw error
|
||||||
|
@ -228,6 +228,7 @@ export default class WebpackBaseConfig {
|
|||||||
const resolvePath = [
|
const resolvePath = [
|
||||||
this.buildContext.options.rootDir,
|
this.buildContext.options.rootDir,
|
||||||
__dirname,
|
__dirname,
|
||||||
|
...(global.__NUXT_PATHS__ || []),
|
||||||
resolveModule('@nuxt/vue-app'),
|
resolveModule('@nuxt/vue-app'),
|
||||||
resolveModule('@nuxt/babel-preset-app')
|
resolveModule('@nuxt/babel-preset-app')
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user