Uploading package.json and vite.config.js files

This commit is contained in:
Amey Bhagwat 2026-10-16 10:13:45 +05:30
parent 7355130e02
commit 366c8c1c4e
2 changed files with 31 additions and 2 deletions

View File

@ -26,6 +26,8 @@
"@rc-component/tour": "^2.1.6",
"@tanstack/react-table": "^8.21.3",
"@xyflow/react": "^12.11.6",
"ag-grid-community": "^32.3.9",
"ag-grid-react": "^32.3.9",
"apexcharts": "^4.7.0",
"apextree": "^1.3.0",
"axios": "^1.11.0",
@ -44,6 +46,7 @@
"datatables.net-select-bs5": "^3.0.1",
"date-fns": "^4.1.0",
"dayjs": "^1.11.13",
"exceljs": "^4.4.0",
"filepond": "^4.32.8",
"filepond-plugin-image-exif-orientation": "^1.0.11",
"filepond-plugin-image-preview": "^4.6.12",

View File

@ -23,7 +23,7 @@ const localServices = {
vgreet: 4003,
};
const proxy = Object.fromEntries(
const localProxy = Object.fromEntries(
Object.entries(localServices).map(([service, port]) => [
`/api/${service}`,
{
@ -34,6 +34,29 @@ const proxy = Object.fromEntries(
]),
);
const productionProxy = {
'/api/ums/hierarchy/get_all': {
target: 'https://ljtw6cnu6kzxm3s76upgsvmz5u0ufrep.lambda-url.ap-south-1.on.aws',
changeOrigin: true,
secure: true,
rewrite: () => '/',
},
'/api': {
target: 'https://rapportapi.click',
changeOrigin: true,
secure: true,
rewrite: (path) => path.replace(/^\/api/, ''),
},
};
const laravelProxy = {
'/laravel-api': {
target: process.env.VITE_LARAVEL_ORIGIN || 'http://127.0.0.1:8000',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/laravel-api/, '/api'),
},
};
export default defineConfig({
plugins: [react()],
resolve: {
@ -43,6 +66,9 @@ export default defineConfig({
},
server: {
port: 5173,
proxy,
proxy: {
...laravelProxy,
...(process.env.VITE_API_MODE === 'local' ? localProxy : productionProxy),
},
},
});