1 Star 0 Fork 3

zlihuay/pi-admin-web

forked from ZnPi/pi-admin-web 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vite.config.ts 1.86 KB
一键复制 编辑 原始数据 按行查看 历史
ZnPi 提交于 2023-06-12 22:50 . 发布 v1.0.0 SNAPSHOT 版
import { fileURLToPath, URL } from "node:url";
import { defineConfig, loadEnv } from "vite";
import vue from "@vitejs/plugin-vue";
import vueJsx from "@vitejs/plugin-vue-jsx";
// Element Plus
import AutoImport from "unplugin-auto-import/vite";
import Components from "unplugin-vue-components/vite";
import { ElementPlusResolver } from "unplugin-vue-components/resolvers";
// vxe-table
import {
createStyleImportPlugin,
VxeTableResolve,
} from "vite-plugin-style-import";
// svg
import path from "path";
import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
import vueSetupExtend from "vite-plugin-vue-setup-extend";
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), "");
return {
server: {
host: "0.0.0.0",
open: true,
proxy: {
[env.VITE_APP_BASE_API]: {
target: "http://localhost:9317",
changeOrigin: true,
rewrite: (path) =>
path.replace(new RegExp("^" + env.VITE_APP_BASE_API), ""),
},
},
},
plugins: [
vue(),
vueJsx(),
AutoImport({
resolvers: [ElementPlusResolver()],
}),
Components({
resolvers: [ElementPlusResolver()],
}),
createSvgIconsPlugin({
iconDirs: [
path.resolve(process.cwd(), "src/assets/icons"),
path.resolve(process.cwd(), "src/assets/icons/bpmn-icons"),
],
symbolId: "icon-[dir]-[name]",
}),
vueSetupExtend(),
createStyleImportPlugin({
resolves: [VxeTableResolve()],
}),
],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
types: fileURLToPath(new URL("./types", import.meta.url)),
"vue-i18n": "vue-i18n/dist/vue-i18n.cjs.js",
},
},
build: {
chunkSizeWarningLimit: 2500,
},
};
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zlihuay/pi-admin-web.git
git@gitee.com:zlihuay/pi-admin-web.git
zlihuay
pi-admin-web
pi-admin-web
master

搜索帮助