加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
.umirc.ts 1.00 KB
一键复制 编辑 原始数据 按行查看 历史
Aladdin 提交于 2023-02-25 22:51 . updare actions
import { defineConfig } from "umi";
const { ENV, PROXY, REPO } = process.env;
const proxyUrl = "/proxy";
const serverUrl = "";
const publicPath = REPO
? "//entropycloud.gitee.io/travel-card-ce/"
: "//aladdin-chu.github.io/travel-card-ce/";
export default defineConfig({
nodeModulesTransform: {
type: "none",
},
history: {
type: "hash",
},
hash: true,
routes: [
{ path: "/", component: "@/pages/index/index" },
{ path: "/result", component: "@/pages/result/index" },
],
define: {
"process.env.mode": ENV ? "development" : "production",
"process.proxy": PROXY ? proxyUrl : null,
"process.admin_prefix": ENV ? "" : "",
"process.server_prefix": ENV ? proxyUrl : serverUrl,
},
proxy: PROXY
? {
[`${proxyUrl}`]: {
target: PROXY,
changeOrigin: true,
pathRewrite: {
[`^${proxyUrl}`]: "",
},
},
}
: {},
fastRefresh: {},
publicPath: ENV ? "/" : publicPath,
title: "行程卡纪念版",
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化