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) },