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) }