From 833a65b466f2043c39bce803a804a50c16ee18a4 Mon Sep 17 00:00:00 2001 From: Eric Wheeler Date: Tue, 13 May 2025 23:03:31 -0700 Subject: [PATCH] feat: enable source maps for improved debugging Enable source maps in the webview UI to help with debugging by: - Adding sourceMap: true to tsconfig.json - Setting inlineSources: false in tsconfig.json - Enabling sourcemap: true in vite.config.ts - Adding source-map package as a dependency This allows stack traces to be mapped back to original source files, making it easier to debug issues in the bundled code. Signed-off-by: Eric Wheeler --- webview-ui/package.json | 1 + webview-ui/tsconfig.json | 2 ++ webview-ui/vite.config.ts | 1 + 3 files changed, 4 insertions(+) diff --git a/webview-ui/package.json b/webview-ui/package.json index b020efbe138..29ba727224a 100644 --- a/webview-ui/package.json +++ b/webview-ui/package.json @@ -59,6 +59,7 @@ "remove-markdown": "^0.6.0", "shell-quote": "^1.8.2", "shiki": "^3.2.1", + "source-map": "^0.7.4", "styled-components": "^6.1.13", "tailwind-merge": "^2.6.0", "tailwindcss": "^4.0.0", diff --git a/webview-ui/tsconfig.json b/webview-ui/tsconfig.json index b942a3408e4..94b4a65bf9a 100644 --- a/webview-ui/tsconfig.json +++ b/webview-ui/tsconfig.json @@ -10,6 +10,8 @@ "forceConsistentCasingInFileNames": true, "noFallthroughCasesInSwitch": true, "module": "esnext", + "sourceMap": true, + "inlineSources": false, "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, diff --git a/webview-ui/vite.config.ts b/webview-ui/vite.config.ts index 061a6dfd894..69163efc3b7 100644 --- a/webview-ui/vite.config.ts +++ b/webview-ui/vite.config.ts @@ -58,6 +58,7 @@ export default defineConfig({ build: { outDir: "build", reportCompressedSize: false, + sourcemap: true, rollupOptions: { output: { entryFileNames: `assets/[name].js`,