import { sveltekit } from '@sveltejs/kit/vite'; import tailwindcss from '@tailwindcss/vite'; import { defineConfig } from 'vite'; // Source maps are always generated so that the CI pipeline can upload them to // GlitchTip via glitchtip-cli after a release build. export default defineConfig({ build: { sourcemap: true }, plugins: [tailwindcss(), sveltekit()], ssr: { // Force these packages to be bundled into the server output rather than // treated as external requires. The production Docker image has no // node_modules, so anything used in server-side code must be inlined. noExternal: ['marked'], // cropperjs is DOM-only (used inside $effect); exclude from SSR bundle. external: ['cropperjs'] }, optimizeDeps: { include: ['cropperjs'] } });