1
This commit is contained in:
@@ -6,7 +6,7 @@ import proxy from './proxy';
|
||||
|
||||
import routes from './routes';
|
||||
|
||||
const { REACT_APP_ENV = 'dev' } = process.env;
|
||||
const { REACT_APP_ENV = 'prod' } = process.env;
|
||||
|
||||
export default defineConfig({
|
||||
/**
|
||||
@@ -47,7 +47,7 @@ export default defineConfig({
|
||||
* @description 如果对国际化没有要求,打开之后能减少js的包大小
|
||||
* @doc https://umijs.org/docs/api/config#ignoremomentlocale
|
||||
*/
|
||||
ignoreMomentLocale: true,
|
||||
ignoreMomentLocale: false,
|
||||
/**
|
||||
* @name 代理配置
|
||||
* @description 可以让你的本地服务器代理到你的服务器上,这样你就可以访问服务器的数据了
|
||||
@@ -55,12 +55,7 @@ export default defineConfig({
|
||||
* @doc 代理介绍 https://umijs.org/docs/guides/proxy
|
||||
* @doc 代理配置 https://umijs.org/docs/api/config#proxy
|
||||
*/
|
||||
proxy: proxy[REACT_APP_ENV as keyof typeof proxy],
|
||||
define: {
|
||||
"process.env": {
|
||||
API_URL: "https://iadminapi.zhongshuai2023.com",
|
||||
},
|
||||
},
|
||||
proxy: proxy['prod'],
|
||||
/**
|
||||
* @name 快速热更新配置
|
||||
* @description 一个不错的热更新组件,更新时可以保留 state
|
||||
|
||||
@@ -51,10 +51,10 @@ export default {
|
||||
},
|
||||
},
|
||||
prod: {
|
||||
'/admin/': {
|
||||
'/api/': {
|
||||
target: 'https://iadminapi.zhongshuai2023.com',
|
||||
changeOrigin: true,
|
||||
pathRewrite: { '^/admin': '/api' },
|
||||
pathRewrite: { '^/api': '/api' },
|
||||
},
|
||||
},
|
||||
pro: {
|
||||
|
||||
Reference in New Issue
Block a user