3 Star 21 Fork 5

土豆哥/quick-vue3-admin

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vite.config.ts 3.47 KB
一键复制 编辑 原始数据 按行查看 历史
土豆哥 提交于 2024-01-30 16:51 +08:00 . 升级vite5
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import eslintPlugin from "vite-plugin-eslint";
import { createHtmlPlugin } from "vite-plugin-html";
import { resolve } from "path";
// import vueSetupExtend from "@ainiteam/vite-plugin-vue3-extend";
import vueSetupExtend from "vite-plugin-vue-setup-extend";
// https://vitejs.dev/config/
export default defineConfig({
base: "./",
plugins: [
// vue({
// template: {
// compilerOptions: {
// isCustomElement: (tag) => tag.includes("quick-")
// }
// }
// }),
vue(),
vueSetupExtend(),
createHtmlPlugin({
inject: {
data: {
title: "quick-vue3-admin"
}
}
}),
eslintPlugin({
include: [
"src/**/*.ts",
"src/**/*.js",
"src/**/*.vue",
"src/*.ts",
"src/*.js",
"src/*.vue"
]
})
],
resolve: {
alias: [
{
find: "@",
replacement: resolve(__dirname, "src")
},
{
find: "vue-i18n",
replacement: "vue-i18n/dist/vue-i18n.cjs.js"
}
]
},
css: {
preprocessorOptions: {
scss: {
additionalData: '@use "@/assets/scss/globalVariable.scss" as *;'
}
}
},
server: {
https: false, // 运行服务是否以https方式
host: true,
port: 3100,
open: false,
proxy: {
"/dev-api/develop": {
target: "http://localhost:3000/", // 代理的目标地址-本地
// target: "https://api.quick.ainiteam.com/", // 代理的目标地址-线上
changeOrigin: true, // 开发模式,默认的origin是真实的 origin:localhost:3102 代理服务会把origin修改为目标地址
secure: true, // 是否https接
ws: false, // 是否代理websockets
rewrite: (path) => path.replace(/^\/dev-api\/develop/, "") // 路径重写
},
"/dev-api": {
// target: "http://localhost:3101/", // 代理的目标地址-本地
target: "https://api.quick.ainiteam.com/", // 代理的目标地址-线上
changeOrigin: true, // 开发模式,默认的origin是真实的 origin:localhost:3102 代理服务会把origin修改为目标地址
secure: true, // 是否https接
ws: false, // 是否代理websockets
rewrite: (path) => path.replace(/^\/dev-api/, "") // 路径重写
}
}
},
preview: {
https: false, // 运行服务是否以https方式
host: true,
port: 3100,
open: false,
proxy: {
"/prod-api": {
target: "http://localhost:3101/", // 代理的目标地址-本地
// target: 'https://api.quick.ainiteam.com/', // 代理的目标地址-线上
changeOrigin: true, // 开发模式,默认的origin是真实的 origin:localhost:3000 代理服务会把origin修改为目标地址
secure: false, // 是否https接口
ws: false, // 是否代理websockets
rewrite: (path) => path.replace(/^\/prod-api/, "") // 路径重写
}
}
}
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/zhanglp520/quick-vue-admin.git
git@gitee.com:zhanglp520/quick-vue-admin.git
zhanglp520
quick-vue-admin
quick-vue3-admin
master

搜索帮助