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:
@@ -1,8 +1,11 @@
|
||||
import { defineConfig } from 'vite'
|
||||
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({
|
||||
plugins: [react()],
|
||||
server: { port: 5173 },
|
||||
build: { outDir: 'dist', sourcemap: true },
|
||||
base: '/crdc-demo/', // Required for subdirectory deployment on git-pages
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user