From 3bb04a7ddc5f1b67d64369efa21b349289dea01a Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Sat, 2 Aug 2025 11:59:12 -0700 Subject: [PATCH] Enable indexeddb in node builds. --- esbuild.mjs | 3 ++- fake-indexeddb.mjs | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 fake-indexeddb.mjs diff --git a/esbuild.mjs b/esbuild.mjs index 42c4a76..2f337af 100644 --- a/esbuild.mjs +++ b/esbuild.mjs @@ -37,6 +37,7 @@ export const nodeOptions = { { in: './src/main.ts', out: 'nodejs.min' } ], dropLabels: ['BROWSER'], - external: ['node:worker_threads'] + external: ['node:worker_threads'], + inject: ['./fake-indexeddb.mjs'] } await build(nodeOptions) diff --git a/fake-indexeddb.mjs b/fake-indexeddb.mjs new file mode 100644 index 0000000..3bfa68b --- /dev/null +++ b/fake-indexeddb.mjs @@ -0,0 +1,4 @@ +//! SPDX-FileCopyrightText: 2025 Chris Duncan +//! SPDX-License-Identifier: GPL-3.0-or-later + +import 'fake-indexeddb/auto' -- 2.47.3