Files
xiaoxia-saas/apps/web/vite.config.ts
T
xiaoxia 68fe8aabd5
CI/CD Pipeline / Frontend Lint (push) Successful in 1m5s
CI/CD Pipeline / Validate Code Quality And Tests (push) Successful in 2m41s
CI/CD Pipeline / Build Production API Image (push) Has been skipped
CI/CD Pipeline / Build Production Worker Image (push) Has been skipped
CI/CD Pipeline / Build Production Web Image (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Unit Tests (push) Successful in 2m56s
CI/CD Pipeline / Build Staging API Image (push) Successful in 25s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 4m12s
CI/CD Pipeline / Integration Tests (push) Successful in 1m57s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 12m34s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 15m17s
CI/CD Pipeline / Staging E2E Tests (push) Successful in 2m16s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 3m17s
perf(ci): P1级Web构建缓存优化 - tsc增量 + Vite构建缓存 (#348)
2026-07-15 10:52:39 +08:00

74 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: {
cache: true,
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",
],
},
});