@ranger1/dx 0.1.109 → 0.1.110
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/vercel-deploy.js +9 -7
- package/package.json +1 -1
package/lib/vercel-deploy.js
CHANGED
|
@@ -38,10 +38,10 @@ const TARGET_CONFIGS = {
|
|
|
38
38
|
|
|
39
39
|
const ALLOWED_DEPLOY_MODES = ['prebuilt']
|
|
40
40
|
|
|
41
|
-
const
|
|
42
|
-
development: 'dev',
|
|
43
|
-
staging: 'staging',
|
|
44
|
-
production: 'prod'
|
|
41
|
+
const DX_ENV_FLAG_MAP = {
|
|
42
|
+
development: '--dev',
|
|
43
|
+
staging: '--staging',
|
|
44
|
+
production: '--prod'
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
const VERCEL_PROJECT_LINK_PATH = '.vercel/project.json'
|
|
@@ -351,8 +351,7 @@ export async function deployToVercel(target, options = {}) {
|
|
|
351
351
|
// - 前置构建/生成(shared/contracts/backend 等)应由项目自己的 Nx 依赖图或 Vercel buildCommand 负责。
|
|
352
352
|
// - 这样 dx deploy 能兼容不同 monorepo 布局(不强依赖 apps/sdk 等目录)。
|
|
353
353
|
|
|
354
|
-
|
|
355
|
-
const buildEnv = APP_ENV_MAP[environment]
|
|
354
|
+
const dxEnvFlag = DX_ENV_FLAG_MAP[environment]
|
|
356
355
|
|
|
357
356
|
for (const t of targets) {
|
|
358
357
|
const targetConfig = getTargetConfig(t)
|
|
@@ -425,7 +424,10 @@ export async function deployToVercel(target, options = {}) {
|
|
|
425
424
|
const envVars = {
|
|
426
425
|
...process.env,
|
|
427
426
|
VERCEL_PROJECT_ID: projectId,
|
|
428
|
-
APP_ENV:
|
|
427
|
+
APP_ENV: environment,
|
|
428
|
+
NEXT_PUBLIC_APP_ENV: environment,
|
|
429
|
+
VITE_APP_ENV: environment,
|
|
430
|
+
DX_ENV_FLAG: dxEnvFlag,
|
|
429
431
|
NODE_ENV: envManager.mapAppEnvToNodeEnv(environment),
|
|
430
432
|
VERCEL_ORG_ID: orgId
|
|
431
433
|
}
|