Files
xiaoxia-saas/apps/web/vite.config.ts
T
xiaoxia fff644deac
Deploy / Build Production Runtime Images (push) Has been skipped
Deploy / Deploy Production (push) Has been skipped
Deploy / Production Browser E2E (push) Has been skipped
Deploy / Deploy Staging (push) Failing after 210h18m25s
CI/CD Pipeline / Frontend Lint (push) Failing after 210h18m51s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 210h18m54s
fix: resolve bandit security issues and fix vitest configuration (#132)
2026-06-30 18:35:20 +08:00

73 lines
1.4 KiB
TypeScript

/**
* 性能优化配置
*/
import { defineConfig, configDefaults } from 'vitest/config';
import react from '@vitejs/plugin-react';
import path from 'path';
// https://vitejs.dev/config/
export default defineConfig({
test: {
exclude: [...configDefaults.exclude, "**/e2e/**"],
environment: "jsdom",
globals: true,
setupFiles: ["./src/test/setup.ts"],
},
plugins: [
react({
fastRefresh: true,
}),
],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
server: {
port: 3000,
proxy: {
'/api': {
target: 'http://localhost:8000',
changeOrigin: true,
},
},
hmr: {
overlay: true,
},
},
build: {
rollupOptions: {
output: {
manualChunks: {
'react-vendor': ['react', 'react-dom', 'react-router-dom'],
'antd-vendor': ['antd', '@ant-design/icons'],
'state-vendor': ['zustand', '@tanstack/react-query', 'axios'],
},
},
},
minify: 'esbuild',
sourcemap: false,
chunkSizeWarningLimit: 1000,
},
css: {
preprocessorOptions: {
less: {
javascriptEnabled: true,
},
},
},
optimizeDeps: {
include: [
'react',
'react-dom',
'react-router-dom',
'antd',
'@ant-design/icons',
'zustand',
'@tanstack/react-query',
'axios',
],
},
});