Files
f85627dcf6 [AI] Disable bundle minification for readable error messages (#7538)
* [AI] Disable bundle minification for readable production error messages

The desktop-client had dead terserOptions (no `minify: 'terser'` was set, so
Vite's default esbuild minifier ran with name mangling). The loot-core and
plugins-service workers used Terser with mangle:false but still compressed.
Set `minify: false` across all three browser build configs so production
stack traces are human-readable.

https://claude.ai/code/session_01VEywxebiNYAgJia35fygQx

* [AI] Rename release note to match PR number

https://claude.ai/code/session_01VEywxebiNYAgJia35fygQx

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-19 20:35:26 +00:00

30 lines
643 B
TypeScript

import path from 'path';
import { defineConfig } from 'vite';
export default defineConfig(({ mode }) => {
const isDev = mode === 'development';
const outDir = path.resolve(__dirname, 'dist');
return {
mode,
build: {
target: 'es2020',
outDir,
emptyOutDir: true,
lib: {
entry: path.resolve(__dirname, 'src/plugin-service-worker.ts'),
name: 'plugin_sw',
formats: ['iife'],
fileName: () => `plugin-sw.js`,
},
sourcemap: true,
minify: false,
},
define: {
'process.env': '{}',
'process.env.IS_DEV': JSON.stringify(isDev),
},
};
});