File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 3737 cache : ' npm'
3838 - name : Install dependencies
3939 run : npm ci
40+ - name : Setup .env.production
41+ run : echo "VITE_IS_GITHUB=true" >> .env.production
4042 - name : Build
41- env :
42- GITHUB : " yes"
4343 run : npm run build
4444 - name : Setup Pages
4545 uses : actions/configure-pages@v5
Original file line number Diff line number Diff line change @@ -4,16 +4,15 @@ import path from "node:path";
44
55declare global {
66 interface ImportMeta {
7- env : {
8- GITHUB : string ;
9- }
7+ env : undefined | Record < `VITE_${string } `, string | undefined > ;
108}
119}
1210// https://vitejs.dev/config/
1311export default defineConfig ( ( ) => {
14- console . log ( "GITHUB:" , import . meta. env ?. GITHUB ) ;
15-
16- const base = import . meta. env ?. GITHUB !== undefined
12+ console . log ( "env:" , import . meta. env ) ;
13+ console . log ( "GITHUB:" , import . meta. env ?. VITE_IS_GITHUB ) ;
14+
15+ const base = import . meta. env ?. VITE_IS_GITHUB === "true"
1716 ? "/SkapEdit/"
1817 : "/" ;
1918 console . log ( "Base:" , base ) ;
You can’t perform that action at this time.
0 commit comments