From e0fec80baf7f04f08e653ae9831df3a88c4aeac5 Mon Sep 17 00:00:00 2001 From: blazmrak Date: Thu, 13 Jan 2022 13:39:23 +0100 Subject: [PATCH] fix(vite): build fails with ssr turned off (#2652) --- packages/vite/src/server.ts | 2 +- packages/vite/src/vite.ts | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/vite/src/server.ts b/packages/vite/src/server.ts index 335e3e0822..a63fc3a660 100644 --- a/packages/vite/src/server.ts +++ b/packages/vite/src/server.ts @@ -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', diff --git a/packages/vite/src/vite.ts b/packages/vite/src/vite.ts index 9fd650d333..77a03ead69 100644 --- a/packages/vite/src/vite.ts +++ b/packages/vite/src/vite.ts @@ -107,7 +107,5 @@ export async function bundle (nuxt: Nuxt) { }) await buildClient(ctx) - if (ctx.nuxt.options.ssr) { - await buildServer(ctx) - } + await buildServer(ctx) }