From 4edc71a611b452596fcbb2e3a17163b54976f8c6 Mon Sep 17 00:00:00 2001 From: flop Date: Tue, 19 May 2026 11:56:04 +0200 Subject: [PATCH] fix: export all methods --- ts/src/web.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ts/src/web.ts b/ts/src/web.ts index bdacece..a8745c8 100644 --- a/ts/src/web.ts +++ b/ts/src/web.ts @@ -507,6 +507,16 @@ function _updateThemeBtn() { window.addEventListener('DOMContentLoaded', _updateThemeBtn); // --- Init --------------------------------------------------------------------- +// Pin all functions referenced from inline HTML onclick/onchange strings so +// Bun's bundler does not tree-shake them as unreachable dead code. +Object.assign(window, { + loadBin, exportBin, + addSection, removeSection, toggleSection, setSectionFlag, + addElement, removeElement, selectElement, + changeElType, setElField, setElFlag, + cycleTheme, +}); + render(); if (window.MonoDisplay) { initDemos(); } else { const iv = setInterval(() => { if (window.MonoDisplay) { clearInterval(iv); initDemos(); } }, 100); }