Skip to content

Commit 77ea2f0

Browse files
committed
fix: use env var for Vite base path to fix GitHub Pages asset loading
The --base CLI flag wasn't reaching Vite through pnpm's argument forwarding, causing assets to load from / instead of /tiny-design/.
1 parent 345486d commit 77ea2f0

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

.github/workflows/deploy-site.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ jobs:
3333
run: pnpm install --frozen-lockfile
3434

3535
- name: Build docs site
36-
run: pnpm --filter @tiny-design/docs build -- --base /tiny-design/
36+
run: pnpm --filter @tiny-design/docs build
37+
env:
38+
VITE_BASE: /tiny-design/
3739

3840
- name: Copy 404.html for SPA routing
3941
run: cp apps/docs/build/index.html apps/docs/build/404.html

apps/docs/vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const reactSrc = path.resolve(__dirname, '../../packages/react/src');
99
const iconsSrc = path.resolve(__dirname, '../../packages/icons/src');
1010

1111
export default defineConfig({
12+
base: process.env.VITE_BASE || '/',
1213
plugins: [
1314
{ enforce: 'pre', ...mdx({
1415
mdxExtensions: ['.mdx', '.md'],

0 commit comments

Comments
 (0)