mirror of
https://github.com/zuiidea/antd-admin
synced 2026-10-12 00:43:55 +00:00
41 lines
980 B
TypeScript
41 lines
980 B
TypeScript
import { defineConfig } from "vite-plus";
|
|
import react from "@vitejs/plugin-react-swc";
|
|
import { tanstackRouter } from "@tanstack/router-plugin/vite";
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
tanstackRouter({
|
|
routesDirectory: "./src/routes",
|
|
generatedRouteTree: "./src/routeTree.gen.ts",
|
|
}),
|
|
react(),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
"@": "/src",
|
|
},
|
|
},
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: (id: string) => {
|
|
if (id.includes("node_modules/antd")) {
|
|
return "vendor-antd";
|
|
}
|
|
if (id.includes("@tanstack/react-router") || id.includes("@tanstack/react-query")) {
|
|
return "vendor-tanstack";
|
|
}
|
|
if (id.includes("lucide-react")) {
|
|
return "vendor-ui";
|
|
}
|
|
},
|
|
},
|
|
},
|
|
chunkSizeWarningLimit: 1024,
|
|
},
|
|
staged: {
|
|
"*": "vp check --fix",
|
|
},
|
|
lint: { options: { typeAware: true, typeCheck: true } },
|
|
});
|