d88ea71590
esbuild inlines __dirname and __filename as static strings when converting ESM TypeScript source to CJS format. These build-time paths shadow the runtime's native __dirname (provided by Bun/Node CJS module wrapper), breaking path resolution for viewer UI, mode loading, and database initialization on end-user machines. Add a post-build step that removes the hardcoded var declarations from all bundled CJS outputs, allowing the runtime globals to work correctly. Fixes #1410