Skip to content

Commit d069c8a

Browse files
committed
viteのパスをリポジトリ名を自動で設定するように修正
1 parent 59c5f86 commit d069c8a

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

.github/workflows/static.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: Build with Vite
3636
run: npm run build
3737
env:
38-
GITHUB_PAGES: true
38+
VITE_BASE_PATH: "/${{ github.event.repository.name }}/"
3939

4040
- name: Setup Pages
4141
uses: actions/configure-pages@v5

vite.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineConfig } from 'vite'
22

33
export default defineConfig({
4-
base: process.env.GITHUB_PAGES ? '/jma-wind-map/' : '/',
4+
base: `/${process.env.VITE_BASE_PATH}/` || '/',
55
build: {
66
sourcemap: true
77
}

0 commit comments

Comments
 (0)