From 81f13013ae4774ad4141c40015d04ae986c7d3c5 Mon Sep 17 00:00:00 2001 From: vinpogo Date: Tue, 3 Mar 2026 13:52:18 +0100 Subject: [PATCH] fix: import.meta.ENV being undefined --- .changeset/orange-towns-sing.md | 5 +++++ packages/vuebugger/src/debug.ts | 2 +- packages/vuebugger/src/index.ts | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/orange-towns-sing.md diff --git a/.changeset/orange-towns-sing.md b/.changeset/orange-towns-sing.md new file mode 100644 index 0000000..25da19e --- /dev/null +++ b/.changeset/orange-towns-sing.md @@ -0,0 +1,5 @@ +--- +"@vingy/vuebugger": patch +--- + +fix: import.meta.ENV not being optional diff --git a/packages/vuebugger/src/debug.ts b/packages/vuebugger/src/debug.ts index edca66f..a8f035d 100644 --- a/packages/vuebugger/src/debug.ts +++ b/packages/vuebugger/src/debug.ts @@ -17,7 +17,7 @@ export const debug = >( groupId: VuebuggerEntry['groupId'], state: T, ): T => { - if (!import.meta.env.DEV) return state + if (!import.meta.env?.DEV) return state const instance = getCurrentInstance() diff --git a/packages/vuebugger/src/index.ts b/packages/vuebugger/src/index.ts index 7a8861b..b279b59 100644 --- a/packages/vuebugger/src/index.ts +++ b/packages/vuebugger/src/index.ts @@ -7,7 +7,7 @@ export { debug } from './debug' const plugin: Plugin<[PluginOptions?]> = { install: (app: App, options?: PluginOptions) => { - if (!import.meta.env.DEV) return + if (!import.meta.env?.DEV) return if (options?.uidFn) setUidGenerator(options.uidFn) setupComposableDevtools(app) },