mirror of
https://github.com/Powerful-517/yys-editor.git
synced 2026-03-05 15:05:27 +00:00
- 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
24 lines
605 B
JavaScript
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))
|
|
}
|
|
}
|
|
})
|