import tailwindcss from '@tailwindcss/vite'; import react from '@vitejs/plugin-react'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; import { defineConfig } from 'vite'; const rootDir = fileURLToPath(new URL('.', import.meta.url)); export default defineConfig(({ command, isPreview }) => ({ // Local development: http://localhost:3000/ // Production build: https://digitalcompass.agency/lucozade/ base: command === 'build' || isPreview === true ? '/lucozade/' : '/', plugins: [react(), tailwindcss()], resolve: { alias: { '@': path.resolve(rootDir, '.'), }, }, server: { host: '0.0.0.0', port: 3000, strictPort: true, hmr: process.env.DISABLE_HMR !== 'true', }, preview: { host: '0.0.0.0', port: 4173, strictPort: true, }, }));