We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a3bb372 + c71d316 commit 43fcda2Copy full SHA for 43fcda2
1 file changed
vite.config.js
@@ -2,9 +2,12 @@ import { defineConfig } from 'vite';
2
import { svelte } from '@sveltejs/vite-plugin-svelte';
3
import { resolve } from 'path';
4
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
+
9
export default defineConfig(({ mode }) => ({
- // Use base '/' for dev server; '/twosides/' for production (GitHub Pages)
- base: mode === 'production' ? '/twosides/' : '/',
10
+ base: mode === 'production' ? BASE_PATH : '/',
11
plugins: [svelte()],
12
build: {
13
rollupOptions: {
0 commit comments