48 lines
1.1 KiB
TypeScript
48 lines
1.1 KiB
TypeScript
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
import { defineConfig } from 'vitest/config'
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
}
|
|
},
|
|
server: {
|
|
host: '0.0.0.0',
|
|
port: 5158,
|
|
proxy: {
|
|
"/api": {
|
|
target: "http://localhost:5157",
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/api/, ""),
|
|
},
|
|
},
|
|
},
|
|
test: {
|
|
globals: true,
|
|
environment: 'jsdom',
|
|
setupFiles: ['./src/__tests__/setup.ts'],
|
|
include: ['src/**/*.spec.ts', 'src/**/*.test.ts'],
|
|
coverage: {
|
|
provider: 'v8',
|
|
reporter: ['text', 'html'],
|
|
reportsDirectory: 'coverage',
|
|
include: ['src/**'],
|
|
exclude: ['src/__tests__/**', 'src/main.ts', 'src/env.d.ts'],
|
|
thresholds: {
|
|
// 棘轮基线(2026-08 首次接入实测:lines 62.4 / funcs 47.7 / stmts 62.4 / branches 73.5),只升不降
|
|
lines: 60,
|
|
functions: 45,
|
|
statements: 60,
|
|
branches: 72,
|
|
},
|
|
},
|
|
},
|
|
})
|