Skip to content

Commit

Permalink
fix: 打包时配置丢失
Browse files Browse the repository at this point in the history
  • Loading branch information
lingting committed Jun 29, 2023
1 parent da92ad4 commit b0463f5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
4 changes: 2 additions & 2 deletions config/config.web.ts → config/config.dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { defineConfig } from 'umi';
export default defineConfig({
define: {
'process.env': {
msg: '现在是 web 环境!',
msg: '现在是 dev 环境!',
request: {
prefix: '/api',
prefix: 'api',
},
},
},
Expand Down
5 changes: 2 additions & 3 deletions config/config.electron.ts → config/config.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ import { defineConfig } from 'umi';
export default defineConfig({
define: {
'process.env': {
msg: '现在是 electron 环境!',
electron: 'electron',
msg: '现在是 prod 环境!',
request: {
prefix: 'http://admin.ballcat.cn/api',
prefix: 'api',
},
},
},
Expand Down
12 changes: 12 additions & 0 deletions config/config.uat.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineConfig } from 'umi';

export default defineConfig({
define: {
'process.env': {
msg: '现在是 uat 环境!',
request: {
prefix: 'api',
},
},
},
});
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"private": true,
"description": "Ballcat",
"scripts": {
"start": "cross-env PORT=9002 HOST=0.0.0.0 REACT_APP_ENV=start UMI_ENV=web umi dev",
"start": "cross-env PORT=9002 HOST=0.0.0.0 REACT_APP_ENV=start UMI_ENV=dev umi dev",
"start:uat": "cross-env PORT=9002 HOST=0.0.0.0 REACT_APP_ENV=start UMI_ENV=uat umi dev",
"start:prod": "cross-env PORT=9002 HOST=0.0.0.0 REACT_APP_ENV=start UMI_ENV=prod umi dev",
"build": "cross-env UMI_ENV=web umi build",
"build": "cross-env UMI_ENV=dev umi build",
"build:uat": "cross-env UMI_ENV=uat umi build",
"build:prod": "cross-env UMI_ENV=prod umi build",
"analyze": "cross-env ANALYZE=1 umi build",
Expand Down

0 comments on commit b0463f5

Please sign in to comment.