Skip to content

Build your personal knowledge base with Trilium Notes

chore(app/share): add workaround for dead code eliminination by webpack

Panagiotis Papadopoulos74f6ad46ae62
diff --git a/src/public/app/share.ts b/src/public/app/share.ts
index 844d621a15..912154986b 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