diff --git a/vite.config.ts b/vite.config.ts index 3b37a34..b575b90 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -62,6 +62,8 @@ export default defineConfig(({ mode }) => { ? `${serverHttpCertBase}.crt` : undefined; + const isTestBuild = ["development", "staging"].includes(mode); + return { plugins: [ suid(), @@ -101,6 +103,10 @@ export default defineConfig(({ mode }) => { } : undefined, }, + esbuild: { + pure: isTestBuild ? undefined : ["console.debug", "console.trace"], + drop: isTestBuild ? undefined : ["debugger"], + }, define: { "import.meta.env.BUILT_AT": `"${new Date().toISOString()}"`, },