File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ CROWDIN_PERSONAL_TOKEN="your_personal_token"
55CROWDIN_PROJECT_ID = " your_project_id"
66
77# Base path for deployment (e.g., /mini-qr for deploying at domain.com/mini-qr)
8- # Default: /
8+ # Default: ./ (relative paths, works at any sub-path without configuration)
99BASE_PATH = /mini-qr
1010
1111VITE_HIDE_CREDITS = false
Original file line number Diff line number Diff line change @@ -33,4 +33,5 @@ dev-dist
3333
3434# Playwright
3535test-results /
36- playwright-report /
36+ playwright-report /
37+ package-lock.json
Original file line number Diff line number Diff line change 33
44< head >
55 < meta charset ="UTF-8 " />
6- < link rel ="icon " type ="image/svg+xml " href ="/favicon.svg " />
7- < link rel ="apple-touch-icon " href ="/apple-touch-icon.png ">
6+ < link rel ="icon " type ="image/svg+xml " href =". /favicon.svg " />
7+ < link rel ="apple-touch-icon " href =". /apple-touch-icon.png ">
88 < meta charset ="UTF-8 ">
99 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
1010 < meta http-equiv ="X-UA-Compatible " content ="ie=edge ">
Original file line number Diff line number Diff line change 77 */
88export function getBasePath ( ) : string {
99 // Vite makes BASE_PATH available at build time through import.meta.env
10- // If BASE_PATH is not set, default to '/'
11- return import . meta. env . BASE_PATH || '/'
10+ // If BASE_PATH is not set, default to './' for relative paths
11+ return import . meta. env . BASE_PATH || '. /'
1212}
1313
1414/**
Original file line number Diff line number Diff line change @@ -7,10 +7,11 @@ import { VitePWA } from 'vite-plugin-pwa'
77export default defineConfig ( ( { mode } ) => {
88 // Load environment variables
99 const env = loadEnv ( mode , '.' , '' )
10- // Get BASE_PATH from environment variable, default to '/'
10+ // Get BASE_PATH from environment variable, default to './' for relative paths
11+ // Using './' ensures the app works when deployed at any sub-path without configuration
1112 // Ensure base path ends with slash for proper URL construction
12- let base = env . BASE_PATH || '/'
13- if ( base !== '/' && ! base . endsWith ( '/' ) ) {
13+ let base = env . BASE_PATH || '. /'
14+ if ( ! base . endsWith ( '/' ) ) {
1415 base = base + '/'
1516 }
1617
You can’t perform that action at this time.
0 commit comments