resolveBuildEnv
●utils · /index·function
Derives environment metadata from process variables, falling back to git rev-parse HEAD for the commit SHA when no variable is present.
Signature
function resolveBuildEnv(input: InputEnv): BuildEnv;Parameters
| Name | Type | Description |
|---|---|---|
input | InputEnv |
Returns
A snapshot with deployment tier, dev flag, and commit SHA.
Example
const env = resolveBuildEnv();
console.log(env.environment); // 'development' | 'preview' | 'production'Related
ParsedHost AppName BuildEnv DevTld Hostname ShopHandle appFromHost isDevelopment
portFromHost
Extract a numeric port from a host string, IPv6safe. Returns null when no port is present or it is not a valid integer.
shopFromHost
Extract the shop identifier from an HTTP host header. Dev TLDs (.localhost / .test): myshop.storefront.localhost:443 → myshop demo.nordcom.store.storefront.loca