From e5ab741a1b96f91b62da4341ab3ceffd304e0f90 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Fri, 22 Apr 2022 17:38:18 +0100 Subject: [PATCH] fix: respect `sourceMap` option (#141) * fix: default esbuild sourceMap option * refactor: set `sourceMap` default to true --- src/options.ts | 1 + src/rollup/config.ts | 2 +- src/rollup/plugins/esbuild.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/options.ts b/src/options.ts index 13228107e4..4191c7620c 100644 --- a/src/options.ts +++ b/src/options.ts @@ -62,6 +62,7 @@ const NitroDefaults: NitroConfig = { analyze: false, moduleSideEffects: ['unenv/runtime/polyfill/'], replace: {}, + sourceMap: true, // Advanced typescript: { diff --git a/src/rollup/config.ts b/src/rollup/config.ts index 1d730390c2..21ea92761c 100644 --- a/src/rollup/config.ts +++ b/src/rollup/config.ts @@ -151,7 +151,7 @@ export const getRollupConfig = (nitro: Nitro) => { // esbuild rollupConfig.plugins.push(esbuild({ target: 'es2019', - sourceMap: true, + sourceMap: nitro.options.sourceMap, ...nitro.options.esbuild?.options })) diff --git a/src/rollup/plugins/esbuild.ts b/src/rollup/plugins/esbuild.ts index 2ed3ee8b55..24116ff6bb 100644 --- a/src/rollup/plugins/esbuild.ts +++ b/src/rollup/plugins/esbuild.ts @@ -86,7 +86,7 @@ export function esbuild (options: Options = {}): Plugin { loader, target, define: options.define, - sourcemap: options.sourceMap !== false, + sourcemap: options.sourceMap, sourcefile: id })