Skip to content

Commit 43fcda2

Browse files
authored
Merge pull request #8 from CenterForSpatialResearch/03-update-ui
routing config test for new URL
2 parents a3bb372 + c71d316 commit 43fcda2

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

vite.config.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ import { defineConfig } from 'vite';
22
import { svelte } from '@sveltejs/vite-plugin-svelte';
33
import { resolve } from 'path';
44

5+
// Allow overriding the base path at build time (e.g., BASE_PATH=/twosides/ for repo pages).
6+
// Default to root '/' so custom domains (twosides.earth) serve assets correctly.
7+
const BASE_PATH = process.env.BASE_PATH || '/';
8+
59
export default defineConfig(({ mode }) => ({
6-
// Use base '/' for dev server; '/twosides/' for production (GitHub Pages)
7-
base: mode === 'production' ? '/twosides/' : '/',
10+
base: mode === 'production' ? BASE_PATH : '/',
811
plugins: [svelte()],
912
build: {
1013
rollupOptions: {

0 commit comments

Comments
 (0)