reverted config change

This commit is contained in:
2ManyProjects 2025-04-26 00:21:53 -05:00
parent 1d6cd19bab
commit 797e9bac4f

View file

@ -1,20 +1,9 @@
import { defineConfig } from 'vite'; import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react'; import react from '@vitejs/plugin-react';
import path from 'path'; import path from 'path';
import dotenv from 'dotenv';
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig(({mode}) => { export default defineConfig({
// Load env variables
const env = loadEnv(mode, process.cwd(), '');
// Determine HMR host based on environment
const isProduction = process.env.ENVIRONMENT === "prod";
const hmrHost = isProduction ? 'rocks.2many.ca' : 'localhost';
const hmrConfig = isProduction
? { host: hmrHost }
: { host: hmrHost, clientPort: 3000 };
return {
plugins: [react()], plugins: [react()],
resolve: { resolve: {
alias: { alias: {
@ -46,7 +35,10 @@ export default defineConfig(({mode}) => {
watch: { watch: {
usePolling: true, usePolling: true,
}, },
hmr: hmrConfig hmr: {
clientPort: 3000,
host: 'localhost',
}
}, },
build: { build: {
outDir: 'dist', outDir: 'dist',
@ -54,5 +46,4 @@ export default defineConfig(({mode}) => {
emptyOutDir: true, emptyOutDir: true,
sourcemap: process.env.NODE_ENV !== 'production' sourcemap: process.env.NODE_ENV !== 'production'
} }
}
}); });