Skip to content

Commit 580beb7

Browse files
committed
chore: remove hardcoded Vercelism from Lunaria
1 parent fb225fe commit 580beb7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

modules/lunaria.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import process from 'node:process'
21
import { defineNuxtModule, useNuxt } from 'nuxt/kit'
32
import { execSync } from 'node:child_process'
43
import { join } from 'node:path'
54
import { existsSync, mkdirSync } from 'node:fs'
65
import { isCI, isTest } from 'std-env'
6+
import { getEnv } from '../config/env.ts'
77

88
export default defineNuxtModule({
99
meta: {
@@ -33,9 +33,10 @@ export default defineNuxtModule({
3333
cwd: nuxt.options.rootDir,
3434
})
3535
} 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 === 'release') {
3940
throw e
4041
}
4142
}

0 commit comments

Comments
 (0)