[READ-ONLY] a fast, modern browser for the npm registry

chore: use `getEnv` environment abstraction in lunaria module (#1146)

authored by philippeserhal.com and committed by

GitHub 7483fbea 4640f271

+5 -4
+5 -4
modules/lunaria.ts
··· 1 - import process from 'node:process' 2 1 import { defineNuxtModule, useNuxt } from 'nuxt/kit' 3 2 import { execSync } from 'node:child_process' 4 3 import { join } from 'node:path' 5 4 import { existsSync, mkdirSync } from 'node:fs' 6 5 import { isCI, isTest } from 'std-env' 6 + import { getEnv } from '../config/env.ts' 7 7 8 8 export default defineNuxtModule({ 9 9 meta: { ··· 33 33 cwd: nuxt.options.rootDir, 34 34 }) 35 35 } catch (e) { 36 - // do not throw when building for staging 37 - const env = process.env.VERCEL_ENV 38 - if (!isCI || (env && env === 'production')) { 36 + // Always throw in local dev. 37 + // In CI, only throw if building for production. 38 + const { env } = await getEnv(!isCI) 39 + if (env === 'dev' || env === 'release') { 39 40 throw e 40 41 } 41 42 }