import { sveltekit } from '@sveltejs/kit/vite'; import tailwindcss from '@tailwindcss/vite'; import { defineConfig } from 'vite'; import type { Plugin } from 'vite'; function socketIOPlugin(): Plugin { return { name: 'socket-io-dev', configureServer(server) { if (!server.httpServer) return; // Dynamic import to avoid bundling socket.io in client import('./src/socket/index.js').then(({ initSocketIO }) => { initSocketIO(server.httpServer!); console.log('Socket.IO dev server initialized'); }); } }; } export default defineConfig({ plugins: [tailwindcss(), sveltekit(), socketIOPlugin()] });