Files
citpl_cms_react_express_pos…/vite.config.js
T
sandhiya-hepl 35e439e69c path correction
2026-07-15 17:56:11 +05:30

26 lines
715 B
JavaScript

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { resolve } from 'path'
// Dev: http://localhost:5173/admin.html (base "/")
// Prod: https://demo.cavinkare.in/citpl_website/admin.html (base "/citpl_website/")
export default defineConfig(({ command }) => ({
base: command === 'serve' ? '/' : '/citpl_website/',
plugins: [react()],
server: {
proxy: {
'/api': 'http://localhost:3001',
'/uploads': 'http://localhost:3001',
},
},
build: {
rollupOptions: {
input: {
main: resolve(__dirname, 'index.html'),
admin: resolve(__dirname, 'admin.html'),
preview: resolve(__dirname, 'preview.html'),
},
},
},
}))