mirror of https://github.com/nuxt/nuxt.git
fix(vite): respect `ctx.nuxt.options.modulesDir` for resolving externals with `vite-node` (#7612)
This commit is contained in:
parent
8621c86055
commit
abd0feb368
|
@ -102,7 +102,7 @@ function createViteNodeMiddleware (ctx: ViteBuildContext, invalidates: Set<strin
|
|||
node.shouldExternalize = async (id: string) => {
|
||||
const result = await isExternal(id)
|
||||
if (result?.external) {
|
||||
return resolveModule(result.id, { url: ctx.nuxt.options.rootDir })
|
||||
return resolveModule(result.id, { url: ctx.nuxt.options.modulesDir })
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue