mirror of
https://github.com/hhftechnology/middleware-manager.git
synced 2026-07-22 22:33:25 +00:00
56 lines
1.6 KiB
JavaScript
56 lines
1.6 KiB
JavaScript
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import path from 'path';
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
},
|
|
},
|
|
server: {
|
|
port: 3000,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:3456',
|
|
changeOrigin: true,
|
|
},
|
|
'/health': {
|
|
target: 'http://localhost:3456',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
sourcemap: true,
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: {
|
|
'react-vendor': ['react', 'react-dom'],
|
|
'ui-vendor': [
|
|
'@radix-ui/react-dialog',
|
|
'@radix-ui/react-dropdown-menu',
|
|
'@radix-ui/react-select',
|
|
'@radix-ui/react-tabs',
|
|
'@radix-ui/react-tooltip',
|
|
],
|
|
'query-vendor': ['@tanstack/react-query'],
|
|
'form-vendor': ['react-hook-form', '@hookform/resolvers', 'zod'],
|
|
'state-vendor': ['zustand'],
|
|
},
|
|
},
|
|
},
|
|
chunkSizeWarningLimit: 1000,
|
|
},
|
|
optimizeDeps: {
|
|
include: [
|
|
'react',
|
|
'react-dom',
|
|
'zustand',
|
|
'@tanstack/react-query',
|
|
'lucide-react',
|
|
],
|
|
},
|
|
});
|