diff --git a/packages/vite/src/client.ts b/packages/vite/src/client.ts index 4cd0a48b8a..307851a395 100644 --- a/packages/vite/src/client.ts +++ b/packages/vite/src/client.ts @@ -51,7 +51,7 @@ export async function buildClient (ctx: ViteBuildContext) { dedupe: ['vue'] }, build: { - sourcemap: ctx.nuxt.options.sourcemap.client, + sourcemap: ctx.nuxt.options.sourcemap.client ? ctx.config.build?.sourcemap ?? true : false, manifest: true, outDir: resolve(ctx.nuxt.options.buildDir, 'dist/client'), rollupOptions: { diff --git a/packages/vite/src/server.ts b/packages/vite/src/server.ts index 5a2c2a403a..f482b8a7cf 100644 --- a/packages/vite/src/server.ts +++ b/packages/vite/src/server.ts @@ -81,7 +81,7 @@ export async function buildServer (ctx: ViteBuildContext) { ] }, build: { - sourcemap: ctx.nuxt.options.sourcemap.server, + sourcemap: ctx.nuxt.options.sourcemap.server ? ctx.config.build?.sourcemap ?? true : false, outDir: resolve(ctx.nuxt.options.buildDir, 'dist/server'), ssr: ctx.nuxt.options.ssr ?? true, rollupOptions: {