Files
zui/vite.config.ts
2026-03-07 00:13:14 +01:00

31 lines
830 B
TypeScript

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'
export default defineConfig({
plugins: [react()],
server: {
proxy: {
// Avoid CORS: browser calls same origin, Vite forwards to Kroki
'/api/kroki': {
target: 'https://kroki.io',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/kroki/, ''),
},
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
// Ensure PostCSS/Vite can resolve the shadcn tailwind CSS file
'shadcn/dist/tailwind.css': path.resolve(
__dirname,
'node_modules/shadcn/dist/tailwind.css'
),
// Optional: map the package to its dist for other imports
shadcn: path.resolve(__dirname, 'node_modules/shadcn/dist'),
}
}
})