fix(vite): don't set explicit conditions in shouldExternalize (#22991)

This commit is contained in:
Daniel Roe 2023-09-04 13:49:26 +01:00 committed by GitHub
parent 3e676a7fd2
commit 16d47ead2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -132,10 +132,7 @@ function createViteNodeApp (ctx: ViteBuildContext, invalidates: Set<string> = ne
node.shouldExternalize = async (id: string) => {
const result = await isExternal(id)
if (result?.external) {
return resolveModule(result.id, {
url: ctx.nuxt.options.modulesDir,
conditions: ['node', 'import', 'require']
}).catch(() => false)
return resolveModule(result.id, { url: ctx.nuxt.options.modulesDir }).catch(() => false)
}
return false
}