50 lines
1.1 KiB
TypeScript
50 lines
1.1 KiB
TypeScript
import { defineConfig } from "vite";
|
|
import vue from "@vitejs/plugin-vue";
|
|
import VueDevTools from "vite-plugin-vue-devtools";
|
|
import path from "node:path";
|
|
|
|
export default defineConfig(({ command }) => ({
|
|
plugins: [
|
|
...(command === "serve" ? [VueDevTools()] : []),
|
|
vue()
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "src")
|
|
}
|
|
},
|
|
build: {
|
|
chunkSizeWarningLimit: 900,
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks(id) {
|
|
if (id.includes("node_modules/element-plus")) {
|
|
return "element-plus";
|
|
}
|
|
|
|
if (id.includes("node_modules/@element-plus/icons-vue")) {
|
|
return "element-plus-icons";
|
|
}
|
|
|
|
if (id.includes("node_modules/vue") || id.includes("node_modules/pinia") || id.includes("node_modules/vue-router")) {
|
|
return "vue-vendor";
|
|
}
|
|
|
|
if (id.includes("node_modules/axios")) {
|
|
return "network-vendor";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
proxy: {
|
|
"/api": {
|
|
target: "http://localhost:5000",
|
|
changeOrigin: true
|
|
}
|
|
}
|
|
}
|
|
}));
|