mirror of
https://git.meshkee.com/novintrades/website.git
synced 2026-08-11 20:50:58 +04:30
Support configurable Vite base for admin path or subdomain deploys.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
722a520e68
commit
5088e0f4ae
@@ -12,7 +12,7 @@ import { ReportagePage } from "./pages/ReportagePage";
|
|||||||
|
|
||||||
export default function App() {
|
export default function App() {
|
||||||
return (
|
return (
|
||||||
<BrowserRouter>
|
<BrowserRouter basename={import.meta.env.BASE_URL.replace(/\/$/, "")}>
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route path="/login" element={<LoginPage />} />
|
<Route path="/login" element={<LoginPage />} />
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ import react from "@vitejs/plugin-react";
|
|||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
|
// Production one-VM path deploy: VITE_BASE=/admin/
|
||||||
|
// Subdomain deploy can omit this (defaults to /).
|
||||||
|
base: process.env.VITE_BASE ?? "/",
|
||||||
server: {
|
server: {
|
||||||
host: "127.0.0.1",
|
host: "127.0.0.1",
|
||||||
port: 5173,
|
port: 5173,
|
||||||
|
|||||||
Reference in New Issue
Block a user