Files
plex-playlist/frontend/vite.config.ts
T

54 lines
1.3 KiB
TypeScript
Raw Normal View History

2025-10-18 21:29:28 -04:00
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { fileURLToPath, URL } from 'node:url'
2025-10-19 21:35:02 -04:00
// 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
}
}
}
2025-10-18 21:29:28 -04:00
// https://vitejs.dev/config/
export default defineConfig({
2025-10-19 21:35:02 -04:00
plugins: [
vue(),
zodAutoValidation()
],
2025-10-18 21:29:28 -04:00
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,
2025-10-19 21:35:02 -04:00
rewrite: (path: string) => path.replace(/^\/api/, '')
2025-10-18 21:29:28 -04:00
}
}
2025-10-19 21:35:02 -04:00
},
define: {
// Enable automatic validation in development
__AUTO_VALIDATE__: JSON.stringify(process.env.NODE_ENV !== 'production')
2025-10-18 21:29:28 -04:00
}
})