33 lines
716 B
TypeScript
33 lines
716 B
TypeScript
|
|
/// <reference types="vitest" />
|
||
|
|
import { defineConfig } from 'vite';
|
||
|
|
import react from '@vitejs/plugin-react';
|
||
|
|
import tailwindcss from '@tailwindcss/vite';
|
||
|
|
import path from 'node:path';
|
||
|
|
|
||
|
|
const apiTarget = process.env.VITE_API_TARGET ?? 'http://localhost:8080';
|
||
|
|
|
||
|
|
export default defineConfig({
|
||
|
|
plugins: [react(), tailwindcss()],
|
||
|
|
resolve: {
|
||
|
|
alias: {
|
||
|
|
'@': path.resolve(__dirname, './src'),
|
||
|
|
},
|
||
|
|
},
|
||
|
|
server: {
|
||
|
|
host: true,
|
||
|
|
port: 5173,
|
||
|
|
proxy: {
|
||
|
|
'/api': {
|
||
|
|
target: apiTarget,
|
||
|
|
changeOrigin: true,
|
||
|
|
rewrite: (p) => p.replace(/^\/api/, ''),
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
test: {
|
||
|
|
environment: 'jsdom',
|
||
|
|
globals: true,
|
||
|
|
setupFiles: ['./src/test/setup.ts'],
|
||
|
|
},
|
||
|
|
});
|