fix(html): prevent tsdown from stripping custom element registrations (#703)

This commit is contained in:
rahim
2026-03-04 19:06:43 +11:00
committed by GitHub
parent 1edeadefed
commit 9a5dfab4e8
36 changed files with 337 additions and 68 deletions
+8
View File
@@ -0,0 +1,8 @@
type DefinableElement = CustomElementConstructor & { tagName: string };
/** Define a custom element only if not already registered. */
export function safeDefine(element: DefinableElement): void {
if (!customElements.get(element.tagName)) {
customElements.define(element.tagName, element);
}
}