[grade=B] DC-072: Enable source maps in production esbuild bundles
CI / Test & Lint (push) Canceled after 0s
CI / Security audit (push) Canceled after 0s

Add sourcemap: 'both' to esbuild.transform — emits inline + external .map
files for production debugging. Stack traces now point to real source lines.

DC-090: Already resolved — Dockerfile pins node:20.11.1-alpine3.19 (specific).
This commit is contained in:
Hermes
2026-08-12 05:08:52 -07:00
parent 84374aab38
commit dad6af4003
+6 -1
View File
@@ -149,13 +149,18 @@ async function build() {
const concatenated = parts.join(';\n'); const concatenated = parts.join(';\n');
// Minify with esbuild (safe to re-minify already-minified code like driver.min.js) // Minify with esbuild (safe to re-minify already-minified code like driver.min.js)
const { code } = await esbuild.transform(concatenated, { // DC-072: sourcemap='both' emits inline + external .map for production debugging
const { code, map } = await esbuild.transform(concatenated, {
minify: true, minify: true,
target: 'es2020', target: 'es2020',
sourcemap: 'both',
}); });
const outPath = path.join(DIST, outName); const outPath = path.join(DIST, outName);
fs.writeFileSync(outPath, code); fs.writeFileSync(outPath, code);
if (map) {
fs.writeFileSync(outPath + '.map', map);
}
const rawSize = (Buffer.byteLength(concatenated) / 1024).toFixed(1); const rawSize = (Buffer.byteLength(concatenated) / 1024).toFixed(1);
const minSize = (Buffer.byteLength(code) / 1024).toFixed(1); const minSize = (Buffer.byteLength(code) / 1024).toFixed(1);