File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { defineConfig } from 'vite'
22import react from '@vitejs/plugin-react'
33
4- /** @param {string } raw */
5- function normalizeBase ( raw ) {
6- const s = ( raw || '/' ) . trim ( )
7- if ( s === '' || s === '/' ) return '/'
8- const withSlash = s . startsWith ( '/' ) ? s : `/${ s } `
9- return withSlash . endsWith ( '/' ) ? withSlash : `${ withSlash } /`
10- }
4+ // Default build is portable/local-download friendly.
5+ // For GitHub Pages, build with:
6+ // VITE_BASE=/publish-to-github/ npm run build
117
12- // GitHub project pages live under /<repo>/ (e.g. https://user.github.io/publish-to-github/).
13- // Build with: VITE_BASE=/your-repo-name/ npm run build
14- const base = normalizeBase ( process . env . VITE_BASE || '/' )
15-
16- // https://vite.dev/config/
178export default defineConfig ( {
18- base,
9+ base : process . env . VITE_BASE || './' ,
1910 plugins : [ react ( ) ] ,
20- } )
11+ } )
You can’t perform that action at this time.
0 commit comments