Skip to content

Commit 62c5eb7

Browse files
committed
fix: ensureEnv is no longer called if usePgLiteOnServer is true
1 parent 8e97fda commit 62c5eb7

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

src/module.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,13 +201,15 @@ export default defineNuxtModule<ModuleOptions>({
201201
async setup(options, nuxt) {
202202
const { resolve } = createResolver(import.meta.url)
203203

204-
ensureEnv(process.env, [
205-
"POSTGRES_HOST",
206-
"POSTGRES_USER",
207-
"POSTGRES_NAME",
208-
"POSTGRES_PORT",
209-
"NUXT_POSTGRES_CONNECTION_OPTIONS_PASSWORD"
210-
] as const, process.env.DISABLE_POSTGRES_ENSURE_ENV === "true")
204+
if (!options.usePgLiteOnServer)
205+
ensureEnv(process.env, [
206+
"POSTGRES_HOST",
207+
"POSTGRES_USER",
208+
"POSTGRES_NAME",
209+
"POSTGRES_PORT",
210+
"NUXT_POSTGRES_CONNECTION_OPTIONS_PASSWORD"
211+
] as const, process.env.DISABLE_POSTGRES_ENSURE_ENV === "true")
212+
}
211213

212214
const moduleName = "@witchcraft/nuxt-postgres"
213215

0 commit comments

Comments
 (0)