2024-10-24 22:23:41 +05:30
|
|
|
import { defineConfig } from 'vite';
|
|
|
|
|
import react from '@vitejs/plugin-react';
|
2024-12-03 23:52:55 +05:30
|
|
|
import dotenv from 'dotenv';
|
|
|
|
|
dotenv.config();
|
2024-10-24 22:23:41 +05:30
|
|
|
|
|
|
|
|
export default defineConfig(() => {
|
2024-12-03 23:52:55 +05:30
|
|
|
const publicUrl = process.env.VITE_PUBLIC_URL || 'http://localhost:5173';
|
|
|
|
|
|
2024-10-24 22:23:41 +05:30
|
|
|
return {
|
2024-11-01 08:27:15 +05:30
|
|
|
define: {
|
|
|
|
|
'import.meta.env.VITE_BACKEND_URL': JSON.stringify(process.env.VITE_BACKEND_URL),
|
2024-12-03 23:52:55 +05:30
|
|
|
'import.meta.env.VITE_PUBLIC_URL': JSON.stringify(publicUrl),
|
2024-11-01 08:27:15 +05:30
|
|
|
},
|
2024-12-03 23:52:55 +05:30
|
|
|
server: {
|
|
|
|
|
host: new URL(publicUrl).hostname,
|
|
|
|
|
port: parseInt(new URL(publicUrl).port),
|
|
|
|
|
},
|
2024-10-24 22:23:41 +05:30
|
|
|
build: {
|
|
|
|
|
outDir: 'build',
|
2024-10-29 21:05:10 +05:30
|
|
|
manifest: true,
|
2024-10-29 23:41:49 +05:30
|
|
|
chunkSizeWarningLimit: 1024,
|
2024-10-24 22:23:41 +05:30
|
|
|
},
|
|
|
|
|
plugins: [react()],
|
|
|
|
|
};
|
|
|
|
|
});
|