Skip to content

Commit 19ec056

Browse files
committed
chore: github page
1 parent 7bd31fe commit 19ec056

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"scripts": {
77
"dev": "vite",
88
"build": "vite build",
9-
"deploy:gh": "gh-pages -d dist",
9+
"build:gh": "vite build --mode gh-pages",
10+
"deploy:gh": "gh-pages -d dist --nojekyll",
1011
"build:analyze": "ANALYZE=true vite build",
1112
"preview": "vite preview",
1213
"test": "vitest",

vite.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import path from 'path';
55
import { visualizer } from 'rollup-plugin-visualizer';
66
import compression from 'vite-plugin-compression';
77

8+
const isGhPages = process.env.VITE_DEPLOY_TARGET === 'GH_PAGES'
9+
810
// https://vitejs.dev/config/
911
export default defineConfig({
1012
plugins: [
@@ -38,7 +40,7 @@ export default defineConfig({
3840
})
3941
: null,
4042
].filter(Boolean),
41-
base: '/grwm.dev/',
43+
base: isGhPages ? '/grwm.dev/' : '/',
4244
build: {
4345
outDir: 'dist',
4446
// Copy public assets including robots.txt and sitemap.xml

0 commit comments

Comments
 (0)