mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
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) => {
|
node.shouldExternalize = async (id: string) => {
|
||||||
const result = await isExternal(id)
|
const result = await isExternal(id)
|
||||||
if (result?.external) {
|
if (result?.external) {
|
||||||
return resolveModule(result.id, { url: ctx.nuxt.options.rootDir })
|
return resolveModule(result.id, { url: ctx.nuxt.options.modulesDir })
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user