import { sveltekit } from '@sveltejs/kit/vite'; import type { UserConfig } from 'vite'; import { execSync } from 'child_process'; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore void !(function () { typeof self == 'undefined' && typeof global == 'object' && // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore (global.self = global); })(); const config: UserConfig = { plugins: [sveltekit()], resolve: { alias: { 'socket.io-client': 'socket.io-client/dist/socket.io.js' } }, define: { __COMMIT__: JSON.stringify(execSync('git rev-parse HEAD').toString().trim().slice(0, 8)) } }; export default config;