reverted config change
This commit is contained in:
parent
1d6cd19bab
commit
797e9bac4f
1 changed files with 41 additions and 50 deletions
|
|
@ -1,20 +1,9 @@
|
|||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import path from 'path';
|
||||
import dotenv from 'dotenv';
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig(({mode}) => {
|
||||
// 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 {
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
resolve: {
|
||||
alias: {
|
||||
|
|
@ -46,7 +35,10 @@ export default defineConfig(({mode}) => {
|
|||
watch: {
|
||||
usePolling: true,
|
||||
},
|
||||
hmr: hmrConfig
|
||||
hmr: {
|
||||
clientPort: 3000,
|
||||
host: 'localhost',
|
||||
}
|
||||
},
|
||||
build: {
|
||||
outDir: 'dist',
|
||||
|
|
@ -54,5 +46,4 @@ export default defineConfig(({mode}) => {
|
|||
emptyOutDir: true,
|
||||
sourcemap: process.env.NODE_ENV !== 'production'
|
||||
}
|
||||
}
|
||||
});
|
||||
Loading…
Reference in a new issue