From fb92790a0a826c90b165cea54696e810f43c4fe8 Mon Sep 17 00:00:00 2001 From: Riccardo Ferretti Date: Wed, 1 Oct 2025 15:58:35 +0200 Subject: [PATCH] Define global in web extension build (fixes #1523) --- packages/foam-vscode/esbuild.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/foam-vscode/esbuild.js b/packages/foam-vscode/esbuild.js index feebd317..f01fa15a 100644 --- a/packages/foam-vscode/esbuild.js +++ b/packages/foam-vscode/esbuild.js @@ -25,6 +25,9 @@ const config = { platform: 'browser', format: 'cjs', outfile: `out/bundles/extension-web.js`, + define: { + global: 'globalThis', + }, plugins: [ polyfillPlugin.polyfillNode({ // Options (optional) @@ -64,7 +67,7 @@ async function main() { ...config[platform], entryPoints: ['src/extension.ts'], bundle: true, - minify: production, + minify: false, //production, sourcemap: !production, sourcesContent: false, external: ['vscode'],