更新: 编译变量导入

This commit is contained in:
moux1024 2025-09-29 15:40:42 +08:00
parent e9cf23abb3
commit a096d4a7bf
3 changed files with 5 additions and 4 deletions

View File

@ -38,9 +38,9 @@ if [ "$current_branch" = "$BRANCH_NAME" ]; then
echo "On dev branch, building project..." | tee -a $LOGFILE
PROFILE_ENV=$BRANCH_NAME
# 安装依赖并构建
# 安装依赖并构建(通过 env-cmd 注入 .env.development 与 NODE_ENV
yarn install
yarn build
npx --yes env-cmd -f .env.development -e development bash -lc 'export NODE_ENV=development; yarn build'
# 准备dist目录
mkdir -p dist

View File

@ -38,9 +38,9 @@ if [ "$current_branch" = "$BRANCH_NAME" ]; then
echo "On prod branch, building project..." | tee -a $LOGFILE
PROFILE_ENV=$BRANCH_NAME
# 安装依赖并构建
# 安装依赖并构建(通过 env-cmd 注入 .env.production 与 NODE_ENV
yarn install
yarn build
npx --yes env-cmd -f .env.production -e production bash -lc 'export NODE_ENV=production; yarn build'
# 准备dist目录
mkdir -p dist

View File

@ -94,6 +94,7 @@
"devDependencies": {
"@types/jest": "^29.5.12",
"@types/lodash": "^4.17.19",
"env-cmd": "^10.1.0",
"jest": "^29.7.0",
"ts-jest": "^29.1.2"
}