28 lines
588 B
TypeScript
28 lines
588 B
TypeScript
/// <reference types="vitest" />
|
|
import { defineConfig, loadEnv } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, process.cwd(), '')
|
|
|
|
const base = env.VITE_BASE || '/'
|
|
const apiTarget = env.DEV_API_TARGET || 'http://127.0.0.1:3201'
|
|
|
|
return {
|
|
base,
|
|
plugins: [react()],
|
|
server: {
|
|
proxy: {
|
|
'/v1': {
|
|
target: apiTarget,
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
test: {
|
|
include: ['src/tests/**/*.test.ts'],
|
|
environment: 'node',
|
|
},
|
|
}
|
|
})
|