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
This commit is contained in:
wujunchen 2026-04-27 19:48:26 +08:00
parent f9e33d4c5d
commit 098fee763c
2 changed files with 5 additions and 2 deletions

5
.gitignore vendored
View file

@ -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/

View file

@ -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',