Files
yys-editor/vite.config.js
rookie4show 92e482e854 fix(deploy): build web app for subpath deployment
- workflows use build:app instead of lib build

- inject VITE_APP_BASE_URL for prod/dev paths

- make vite base configurable via env

- update acceptance status for wiki compatibility
2026-02-28 00:30:24 +08:00

24 lines
605 B
JavaScript

import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
const normalizeBase = (value) => {
if (!value || value === '/') return '/'
const withLeadingSlash = value.startsWith('/') ? value : `/${value}`
return withLeadingSlash.endsWith('/') ? withLeadingSlash : `${withLeadingSlash}/`
}
// https://vitejs.dev/config/
export default defineConfig({
base: normalizeBase(process.env.VITE_APP_BASE_URL || '/'),
plugins: [
vue(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
}
})