32 lines
730 B
TypeScript
32 lines
730 B
TypeScript
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
import { fileURLToPath, URL } from 'node:url'
|
|
import { readFileSync } from 'node:fs'
|
|
import { resolve } from 'node:path'
|
|
|
|
const version = readFileSync(resolve(__dirname, '../../VERSION'), 'utf-8').trim()
|
|
|
|
export default defineConfig({
|
|
base: '/admin/',
|
|
define: {
|
|
__APP_VERSION__: JSON.stringify(version),
|
|
},
|
|
plugins: [vue(), tailwindcss()],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
}
|
|
},
|
|
server: {
|
|
host: true,
|
|
port: 4001,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://127.0.0.1:18888',
|
|
changeOrigin: true,
|
|
}
|
|
}
|
|
}
|
|
})
|