Commit 7beefd79 authored by 前端-许佳敏's avatar 前端-许佳敏

chore: 添加环境变量到umi

parent f0f18294
......@@ -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: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment