Allow console in development builds

This commit is contained in:
Jesper Kristensen 2025-06-24 16:03:04 +02:00
parent 0b1db0b216
commit d928b773ef
No known key found for this signature in database
GPG Key ID: D21D8D9A823A2F42
2 changed files with 6 additions and 4 deletions

View File

@ -6,7 +6,8 @@
"dev": "npm run pyodide:fetch && vite dev --host",
"dev:5050": "npm run pyodide:fetch && vite dev --port 5050",
"build": "npm run pyodide:fetch && vite build",
"build:watch": "npm run pyodide:fetch && vite build --watch",
"build:watch": "npm run pyodide:fetch && vite build --mode dev --watch",
"build:dev": "npm run pyodide:fetch && vite build --mode dev",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",

View File

@ -17,7 +17,7 @@ import { viteStaticCopy } from 'vite-plugin-static-copy';
// }
// };
export default defineConfig({
export default defineConfig(({ mode }) => ({
plugins: [
sveltekit(),
viteStaticCopy({
@ -41,6 +41,7 @@ export default defineConfig({
format: 'es'
},
esbuild: {
pure: ['console.log', 'console.debug']
// Only purge console.log when not in dev mode
pure: mode === 'dev' ? [] : ['console.log', 'console.debug']
}
});
}));