fix(vite): build fails with ssr turned off (#2652)

This commit is contained in:
blazmrak 2022-01-13 13:39:23 +01:00 committed by GitHub
parent baa0853afa
commit e0fec80baf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -54,7 +54,7 @@ export async function buildServer (ctx: ViteBuildContext) {
},
build: {
outDir: resolve(ctx.nuxt.options.buildDir, 'dist/server'),
ssr: true,
ssr: ctx.nuxt.options.ssr ?? true,
rollupOptions: {
output: {
entryFileNames: 'server.mjs',

View File

@ -107,7 +107,5 @@ export async function bundle (nuxt: Nuxt) {
})
await buildClient(ctx)
if (ctx.nuxt.options.ssr) {
await buildServer(ctx)
}
await buildServer(ctx)
}