Skip to content

Commit bf83519

Browse files
author
Luca Forstner
committed
feat: Detect Vercel env
1 parent 1d5a8ca commit bf83519

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/bundler-plugin-core/src/options-mapping.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ export function normalizeUserOptions(userOptions: UserOptions) {
3939
_experiments: userOptions._experiments ?? {},
4040
};
4141

42+
if (
43+
options.release.deploy === undefined &&
44+
process.env["VERCEL"] &&
45+
process.env["VERCEL_TARGET_ENV"]
46+
) {
47+
options.release.deploy = {
48+
env: `vercel-${process.env["VERCEL_TARGET_ENV"]}`,
49+
url: process.env["VERCEL_URL"],
50+
};
51+
}
52+
4253
return options;
4354
}
4455

0 commit comments

Comments
 (0)