From 2b37d72eb97917ce135ec5293f53dc81785a0d6f Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Thu, 8 Sep 2022 14:52:30 +0100 Subject: [PATCH] fix(vite): allow overriding vite sourcemap (#7342) --- packages/vite/src/client.ts | 2 +- packages/vite/src/server.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vite/src/client.ts b/packages/vite/src/client.ts index 4cd0a48b8ac..307851a3956 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 5a2c2a403ac..f482b8a7cf1 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: {