Skip to content

Commit

Permalink
Update vite.config.js
Browse files Browse the repository at this point in the history
  • Loading branch information
shivam-tiwari-21 authored Jan 4, 2025
1 parent 09f3085 commit fcdd10a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import { defineConfig } from 'vite'; // Import defineConfig
import react from '@vitejs/plugin-react'; // Import the React plugin

// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
define: {
'process.env': process.env,
'process.env': process.env, // Pass environment variables
},
server: {
port: process.env.PORT || 3000,
host: '0.0.0.0',
port: process.env.PORT || 3000, // Use Render's PORT variable
host: '0.0.0.0', // Bind to all network interfaces
},
preview: {
port: process.env.PORT || 3000,
port: process.env.PORT || 3000, // Same as server settings
host: '0.0.0.0',
},
base: '/', // Use '/' for root deployment
base: '/', // Adjust this if deploying to a subdirectory
});

0 comments on commit fcdd10a

Please sign in to comment.