From 74f6ad46ae627ae70ba1f25de11d2b9dc520a7c7 Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Sun, 26 Jan 2025 21:23:08 +0100 Subject: [PATCH] chore(app/share): add workaround for dead code eliminination by webpack since fetchNote function is not used anywhere, webpack will treat it as "dead code" and remove it from the final output I did not have any success with using webpack config flags like "sideEffects", so I've reverted to this workaround for now --- src/public/app/share.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/public/app/share.ts b/src/public/app/share.ts index 844d621a1..912154986 100644 --- a/src/public/app/share.ts +++ b/src/public/app/share.ts @@ -25,3 +25,9 @@ document.addEventListener( }, false ); + +// workaround to prevent webpack from removing "fetchNote" as dead code: +// add fetchNote as property to the window object +Object.defineProperty(window, "fetchNote", { + value: fetchNote +}); \ No newline at end of file