feat: add landing page
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { defineConfig, loadEnv } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
|
||||
function normalizeBasePath(value: string | undefined) {
|
||||
const raw = value?.trim();
|
||||
if (!raw || raw === '/') return '/';
|
||||
if (raw === './') return './';
|
||||
if (/^https?:\/\//.test(raw)) {
|
||||
return raw.endsWith('/') ? raw : `${raw}/`;
|
||||
}
|
||||
return `/${raw.replace(/^\/+|\/+$/g, '')}/`;
|
||||
}
|
||||
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd(), '');
|
||||
|
||||
return {
|
||||
base: normalizeBasePath(env.VITE_BASE_PATH),
|
||||
plugins: [react()],
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user