import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; import path from 'path'; // https://vite.dev/config/ export default defineConfig(({ mode = 'local' }) => { const isDev = mode === 'dev'; const isProd = mode === 'prod'; return { plugins: [react()], server:{ host: true, allowedHosts: ['.code-catalyst.com'], cors: true, hmr: isDev ? { protocol: 'wss', host: 'shift-dev.code-catalyst.com', clientPort: 443, } : isProd ? { protocol: 'wss', host: 'shift.code-catalyst.com', clientPort: 443, } : { protocol: 'wss', host: 'localhost', clientPort: 443, }, }, resolve: { alias: { '@src': path.resolve(__dirname, 'src'), '@components': path.resolve(__dirname, 'components') }, }, } });