From bf27b458d8ec6b5c3d3ee44ddff65b65d704e3b4 Mon Sep 17 00:00:00 2001 From: antidoid Date: Tue, 30 Jan 2024 17:32:42 +0530 Subject: [PATCH] Update: Vite config --- frontend/vite.config.ts | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 5a33944..758430a 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -1,7 +1,15 @@ -import { defineConfig } from 'vite' -import react from '@vitejs/plugin-react' +import { defineConfig } from "vite"; +import react from "@vitejs/plugin-react"; -// https://vitejs.dev/config/ -export default defineConfig({ - plugins: [react()], -}) +export default defineConfig(({ command }) => { + const config = { + plugins: [react()], + base: "/", + }; + + if (command !== "serve") { + config.base = "/az-qr-code/"; + } + + return config; +});