Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-admin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project
jinfa-admin
Commits
76f126bb
Commit
76f126bb
authored
Nov 19, 2021
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 优化构建
parent
c0819f70
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
config.ts
config/config.ts
+13
-6
No files found.
config/config.ts
View file @
76f126bb
...
...
@@ -7,18 +7,25 @@
import
{
defineConfig
}
from
'umi'
;
import
routes
from
'./routes/index'
import
proxy
from
'./proxy'
import
CaseSensitivePathsWebpackPlugins
from
'case-sensitive-paths-webpack-plugin'
import
theme
from
'./theme.config'
import
envValue
from
'../env'
import
{
setEnv
,
getEnv
}
from
'../scripts/utils/envTool.js'
// 构建时带上的环境变量
const
PRO_ENV
=
process
.
env
.
PRO_ENV
const
PRO_ENV
=
process
.
env
.
PRO_ENV
||
''
if
(
!
PRO_ENV
)
{
throw
`请传入PRO_ENV`
if
(
PRO_ENV
)
{
const
envs
=
envValue
[
PRO_ENV
]
if
(
envs
)
{
Object
.
keys
(
envs
).
forEach
(
key
=>
{
process
.
env
[
key
]
=
envs
[
key
]
})
}
}
else
{
console
.
warn
(
'未传入PRO_ENV, 如果是 yarn的时候出现 可以忽略'
)
}
setEnv
(
getEnv
(
envValue
))
export
default
defineConfig
({
title
:
'瓴犀平台后台'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment