16 lines
456 B
JavaScript
16 lines
456 B
JavaScript
import { defineConfig, loadEnv } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
// Use relative base so built assets load correctly from filesystem/Electron
|
|
// Ports are defined in the root .env file (PORT_FRONTEND_DEV, PORT_BACKEND)
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, '../', '')
|
|
return {
|
|
base: './',
|
|
plugins: [react()],
|
|
server: {
|
|
port: parseInt(env.PORT_FRONTEND_DEV) || 5173,
|
|
},
|
|
}
|
|
})
|