Files
thrillwiki_django_no_react/frontend/vite.config.ts
pacnpal 08a4a2d034 feat: Add PrimeProgress, PrimeSelect, and PrimeSkeleton components with customizable styles and props
- Implemented PrimeProgress component with support for labels, helper text, and various styles (size, variant, color).
- Created PrimeSelect component with dropdown functionality, custom templates, and validation states.
- Developed PrimeSkeleton component for loading placeholders with different shapes and animations.
- Updated index.ts to export new components for easy import.
- Enhanced PrimeVueTest.vue to include tests for new components and their functionalities.
- Introduced a custom ThrillWiki theme for PrimeVue with tailored color schemes and component styles.
- Added ambient type declarations for various components to improve TypeScript support.
2025-08-27 21:00:02 -04:00

58 lines
1.5 KiB
TypeScript

import { fileURLToPath, URL } from 'node:url'
import Components from 'unplugin-vue-components/vite';
import {PrimeVueResolver} from '@primevue/auto-import-resolver';
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueDevTools from 'vite-plugin-vue-devtools'
import tailwindcss from '@tailwindcss/vite'
// https://vite.dev/config/
export default defineConfig(({ mode }) => ({
plugins: [
vue(),
vueDevTools(),
tailwindcss(),
Components({
resolvers: [PrimeVueResolver()],
dts: true, // Generate TypeScript declaration
}),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
},
},
server: {
proxy: {
'/api': {
target: 'http://127.0.0.1:8000/api/v1',
changeOrigin: true,
secure: false,
ws: true,
rewrite: (path) => path.replace(/^\/api/, ''),
// Frontend calls /api/parks/ -> rewrites to /parks/ -> target adds /api/v1 -> /api/v1/parks/
}
}
},
build: {
outDir: 'dist',
sourcemap: mode === 'development',
minify: mode === 'production',
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('node_modules')) {
if (id.includes('vue') || id.includes('pinia') || id.includes('vue-router')) {
return 'vue-vendor';
}
if (id.includes('lucide-vue-next')) {
return 'ui-vendor';
}
return 'vendor';
}
}
}
}
}
}))