fix(bridge): don't instantiate vite builder if only preparing types (#3050)

This commit is contained in:
Daniel Roe 2022-02-03 18:03:04 +00:00 committed by GitHub
parent fae2179ee9
commit 8edd4819c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,6 +45,7 @@ export default defineNuxtModule<ViteOptions>({
addPluginTemplate(middlewareTemplate)
nuxt.hook('builder:prepared', async (builder) => {
if (nuxt.options._prepare) { return }
builder.bundleBuilder.close()
delete builder.bundleBuilder
const { ViteBuilder } = await import('./vite')