Skip to content

Commit 4feb25f

Browse files
committed
Add BASE_PATH configuration for GitHub Pages subpath
1 parent 3d6ea6b commit 4feb25f

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/deploy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525
run: pnpm install
2626

2727
- name: Build
28+
env:
29+
BASE_PATH: '/${{ github.event.repository.name }}'
2830
run: pnpm run build
2931

3032
- name: List build output

svelte.config.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import adapter from '@sveltejs/adapter-static';
22

3+
const dev = process.argv.includes('dev');
4+
35
/** @type {import('@sveltejs/kit').Config} */
46
const config = {
57
kit: {
@@ -9,7 +11,11 @@ const config = {
911
fallback: undefined,
1012
precompress: false,
1113
strict: true
12-
})
14+
}),
15+
appDir: 'app',
16+
paths: {
17+
base: dev ? '' : process.env.BASE_PATH
18+
}
1319
}
1420
};
1521

0 commit comments

Comments
 (0)