mirror of
https://github.com/readur/readur.git
synced 2026-01-06 06:20:17 -06:00
43 lines
962 B
TypeScript
43 lines
962 B
TypeScript
import { defineConfig } from 'vitest/config'
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
const BACKEND_PORT = process.env.BACKEND_PORT || '8000'
|
|
const CLIENT_PORT = process.env.CLIENT_PORT || '5173'
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
test: {
|
|
environment: 'jsdom',
|
|
globals: true,
|
|
setupFiles: ['src/test/setup.ts'],
|
|
exclude: [
|
|
'**/node_modules/**',
|
|
'**/dist/**',
|
|
'**/cypress/**',
|
|
'**/.{idea,git,cache,output,temp}/**',
|
|
'**/e2e/**',
|
|
'**/*.integration.test.{js,jsx,ts,tsx}',
|
|
],
|
|
},
|
|
server: {
|
|
port: parseInt(CLIENT_PORT),
|
|
proxy: {
|
|
'/api': {
|
|
target: `http://localhost:${BACKEND_PORT}`,
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
assetsDir: 'assets',
|
|
rollupOptions: {
|
|
onwarn(warning, warn) {
|
|
if (warning.code === 'MODULE_LEVEL_DIRECTIVE') {
|
|
return
|
|
}
|
|
warn(warning)
|
|
}
|
|
}
|
|
},
|
|
}) |