46 lines
1021 B
TypeScript
46 lines
1021 B
TypeScript
import { defineConfig } from "vite";
|
|
import vue from "@vitejs/plugin-vue";
|
|
import path from "node:path";
|
|
|
|
export default defineConfig({
|
|
plugins: [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
|
|
}
|
|
}
|
|
}
|
|
});
|