fix: relative base + runtime config for frontgen placement
This commit is contained in:
parent
e9478838d4
commit
48b8f05204
@ -3,6 +3,8 @@
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<!--BASE_HREF-->
|
||||
<script src="./config.js"></script>
|
||||
<title>Office Asset Management</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@ -8,7 +8,7 @@ import './styles/global.css'
|
||||
|
||||
ReactDOM.createRoot(document.getElementById("root")).render(
|
||||
<React.StrictMode>
|
||||
<BrowserRouter basename={import.meta.env.BASE_URL}>
|
||||
<BrowserRouter basename={import.meta.env.DEV ? "/" : new URL(document.baseURI).pathname}>
|
||||
<AuthProvider>
|
||||
<AppProvider>
|
||||
<App />
|
||||
|
||||
@ -2,8 +2,8 @@ import { defineConfig } from "vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
|
||||
export default defineConfig(({ command }) => ({
|
||||
// The preview runs at https://preview-dev.getzino.in/asset-management/
|
||||
base: command === "build" ? "/asset-management/" : "/",
|
||||
// Relative base: frontgen places one artifact at any mount path and injects <base href>.
|
||||
base: "./",
|
||||
plugins: [react()],
|
||||
server: {
|
||||
port: 5173,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user