Files
plex-playlist/frontend/vite.config.ts
Cliff Hill 8aa8d41e8a
Some checks failed
CI/CD Pipeline / Backend Tests (Python) (push) Has been cancelled
CI/CD Pipeline / Frontend Tests (TypeScript/Vue) (push) Has been cancelled
CI/CD Pipeline / Integration Tests (push) Has been cancelled
Did some things, made more improvements.
Signed-off-by: Cliff Hill <xlorep@darkhelm.org>
2025-10-19 21:35:02 -04:00

54 lines
1.3 KiB
TypeScript

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { fileURLToPath, URL } from 'node:url'
// Custom plugin for automatic Zod validation in development
function zodAutoValidation() {
return {
name: 'zod-auto-validation',
transform(code: string, id: string) {
// Only apply in development/test environments
if (process.env.NODE_ENV === 'production') {
return null
}
// Add automatic validation for functions with Zod schemas
if (id.includes('src/') && id.endsWith('.ts')) {
// This would normally be a more sophisticated transform
// For now, we rely on our AutoValidator pattern
return null
}
return null
}
}
}
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
zodAutoValidation()
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
server: {
host: '0.0.0.0',
port: 5173,
proxy: {
'/api': {
target: 'http://backend:8000',
changeOrigin: true,
rewrite: (path: string) => path.replace(/^\/api/, '')
}
}
},
define: {
// Enable automatic validation in development
__AUTO_VALIDATE__: JSON.stringify(process.env.NODE_ENV !== 'production')
}
})