Fix base URL for subdirectory deployment on pages.civilytics.org
Deploy to git-pages / deploy (push) Successful in 10s
Deploy to git-pages / deploy (push) Successful in 10s
- Set vite.config.mjs base to '/crdc-demo/' so asset paths resolve correctly when served from a subdirectory (not root) - Add favicon.svg in public/ folder - Update index.html with correct absolute paths including /crdc-demo/ prefix
This commit is contained in:
+2
-1
@@ -2,12 +2,13 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
<link rel="icon" type="image/svg+xml" href="/crdc-demo/favicon.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>CRDC Arrests API Demo — Civilytics</title>
|
<title>CRDC Arrests API Demo — Civilytics</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
<!-- Vite injects the correct script tag with base-relative path -->
|
||||||
<script type="module" src="/src/main.jsx"></script>
|
<script type="module" src="/src/main.jsx"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#C25311" d="M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0z"/></svg>
|
||||||
|
After Width: | Height: | Size: 128 B |
@@ -1,8 +1,11 @@
|
|||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
import react from '@vitejs/plugin-react-swc'
|
import react from '@vitejs/plugin-react-swc'
|
||||||
|
|
||||||
|
// The app is served at /crdc-demo/ on pages.civilytics.org.
|
||||||
|
// Set base to the subdirectory so asset paths resolve correctly.
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
server: { port: 5173 },
|
server: { port: 5173 },
|
||||||
build: { outDir: 'dist', sourcemap: true },
|
build: { outDir: 'dist', sourcemap: true },
|
||||||
|
base: '/crdc-demo/', // Required for subdirectory deployment on git-pages
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user