fix empty template error

This commit is contained in:
Nicolas 2025-01-13 15:14:07 +01:00
parent 2728700a95
commit 809a0b8014
2 changed files with 2 additions and 1 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "@lightweight-sdk/web-component", "name": "@lightweight-sdk/web-component",
"version": "0.0.0", "version": "0.0.1",
"description": "A lightweight library to build web components easily", "description": "A lightweight library to build web components easily",
"scripts": { "scripts": {
"build": "tsc -b", "build": "tsc -b",

View file

@ -21,5 +21,6 @@ export function findRefElement(ref: string, parent?: HTMLElement): HTMLElement |
* @returns the template as a string * @returns the template as a string
*/ */
export function parseModuleToHtml(mod: any): string { export function parseModuleToHtml(mod: any): string {
if (mod == null) return "";
return "default" in mod ? mod.default as string : ""; return "default" in mod ? mod.default as string : "";
} }