From 098fee763c5eab90fc987c0b5e80d6e7e52e01a0 Mon Sep 17 00:00:00 2001 From: wujunchen Date: Mon, 27 Apr 2026 19:48:26 +0800 Subject: [PATCH] build: enable linked source maps for production builds Generates main.js.map alongside main.js so error stack traces in the Obsidian developer console point to original source locations. Change-Id: I3f63196bfa421c2ac69aee371e4c294d42ee629c --- .gitignore | 5 ++++- esbuild.config.mjs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 00673e8..e8041b7 100644 --- a/.gitignore +++ b/.gitignore @@ -9,10 +9,13 @@ cache.json *.swp *.swo -# Node (if build tooling is added later) +# Node node_modules/ dist/ *.log +# Build artifacts (source maps) +main.js.map + # Agent state .agent/ diff --git a/esbuild.config.mjs b/esbuild.config.mjs index a41f12f..da556d7 100644 --- a/esbuild.config.mjs +++ b/esbuild.config.mjs @@ -18,7 +18,7 @@ const context = await esbuild.context({ format: 'cjs', target: 'es2022', external, - sourcemap: production ? false : 'inline', + sourcemap: production ? 'linked' : 'inline', treeShaking: true, minify: production, outfile: 'main.js',