Skip to content

Commit 22663e6

Browse files
committed
set urls properly for github pages
1 parent 0e1a00c commit 22663e6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

vite.config.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { defineConfig } from "vite";
2+
3+
export default defineConfig(({ mode }) => {
4+
// Default for local dev
5+
let base = "/";
6+
7+
// GitHub Actions sets GITHUB_REPOSITORY=owner/repo
8+
if (process.env.GITHUB_REPOSITORY) {
9+
const repo = process.env.GITHUB_REPOSITORY.split("/")[1];
10+
base = `/${repo}/`;
11+
}
12+
13+
return {
14+
base,
15+
};
16+
});

0 commit comments

Comments
 (0)