import adapter from '@sveltejs/adapter-node'; import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; /** @type {import('@sveltejs/kit').Config} */ const config = { // Consult https://svelte.dev/docs/kit/integrations // for more information about preprocessors preprocess: vitePreprocess(), // 忽略图表组件的无障碍警告 onwarn: (warning, handler) => { if (warning.code.startsWith('a11y_')) return; handler(warning); }, kit: { // 使用 adapter-node 以支持 Docker 部署 adapter: adapter({ out: 'build' }), // 信任的来源(禁用 CSRF 检查) csrf: { trustedOrigins: ['*'] } } }; export default config;