Skip to content

Commit c0ea936

Browse files
author
Jove Zhong
committed
Update vite.config.ts
set basepath per deployment
1 parent 37d1f00 commit c0ea936

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

vite.config.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
import path from "path"
2-
import react from "@vitejs/plugin-react"
3-
import { defineConfig } from "vite"
1+
import path from "path";
2+
import react from "@vitejs/plugin-react";
3+
import { defineConfig } from "vite";
4+
5+
// Set base path dynamically based on environment
6+
const isProduction = process.env.NODE_ENV === "production";
7+
const basePath = isProduction ? "/demos.timeplus.com/" : "";
48

59
export default defineConfig({
10+
base: basePath,
611
plugins: [react()],
712
resolve: {
813
alias: {
914
"@": path.resolve(__dirname, "./src"),
1015
},
1116
},
12-
})
13-
17+
});

0 commit comments

Comments
 (0)