Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
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
linweijiong
jinfa-platform
Commits
7beefd79
Commit
7beefd79
authored
Nov 18, 2021
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 添加环境变量到umi
parent
f0f18294
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
config.ts
config/config.ts
+10
-0
No files found.
config/config.ts
View file @
7beefd79
...
...
@@ -2,11 +2,21 @@ import { defineConfig } from 'umi';
import
routes
from
'./router'
;
import
proxy
from
'./proxy'
;
import
theme
from
'./lingxi.theme.config'
;
import
envValue
from
'../env'
import
{
setEnv
,
getEnv
}
from
'../scripts/utils/envTool.js'
import
CaseSensitivePathsWebpackPlugins
from
'case-sensitive-paths-webpack-plugin'
const
OPEN_THEME_BUILD
=
process
.
env
.
NODE_ENV
===
'production'
?
true
:
false
;
// 是否开启动态主题
const
isProduction
=
process
.
env
.
NODE_ENV
===
'production'
?
true
:
false
;
// 构建时带上的环境变量
const
PRO_ENV
=
process
.
env
.
PRO_ENV
if
(
!
PRO_ENV
)
{
throw
`请传入PRO_ENV`
}
setEnv
(
getEnv
(
envValue
))
const
config
:
any
=
{
// 如需写入环境变量 需在config中先写入
define
:
{
...
...
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