diff --git a/packages/vite/src/client.ts b/packages/vite/src/client.ts index 2722b4deed..2006913a02 100644 --- a/packages/vite/src/client.ts +++ b/packages/vite/src/client.ts @@ -75,7 +75,7 @@ export async function buildClient (ctx: ViteBuildContext) { }, cacheDir: resolve(ctx.nuxt.options.rootDir, 'node_modules/.cache/vite', 'client'), build: { - sourcemap: ctx.nuxt.options.sourcemap.client ? ctx.config.build?.sourcemap ?? true : false, + sourcemap: ctx.nuxt.options.sourcemap.client ? ctx.config.build?.sourcemap ?? ctx.nuxt.options.sourcemap.client : false, manifest: 'manifest.json', outDir: resolve(ctx.nuxt.options.buildDir, 'dist/client'), rollupOptions: { diff --git a/packages/vite/src/server.ts b/packages/vite/src/server.ts index 8df736a1f1..9992ee6640 100644 --- a/packages/vite/src/server.ts +++ b/packages/vite/src/server.ts @@ -74,7 +74,7 @@ export async function buildServer (ctx: ViteBuildContext) { build: { // we'll display this in nitro build output reportCompressedSize: false, - sourcemap: ctx.nuxt.options.sourcemap.server ? ctx.config.build?.sourcemap ?? true : false, + sourcemap: ctx.nuxt.options.sourcemap.server ? ctx.config.build?.sourcemap ?? ctx.nuxt.options.sourcemap.server : false, outDir: resolve(ctx.nuxt.options.buildDir, 'dist/server'), ssr: true, rollupOptions: {