File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ import path from 'path';
55import { visualizer } from 'rollup-plugin-visualizer' ;
66import compression from 'vite-plugin-compression' ;
77
8+ const isGhPages = process . env . VITE_DEPLOY_TARGET === 'GH_PAGES'
9+
810// https://vitejs.dev/config/
911export 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
You can’t perform that action at this time.
0 commit comments