fix: legacy compatibility issue with esm templates and defineWidget

This commit is contained in:
dpiercey 2023-11-10 10:24:08 -07:00 committed by Dylan Piercey
parent c113eda7d9
commit 37b347eb5e
2 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"marko": patch
---
Improve compatibility of legacy Marko widgets loading a template compiled as esm.

View File

@ -320,7 +320,7 @@ module.exports = function defineWidget(def, renderer) {
template = req(template);
}
registry.r(template.___typeName, function () {
registry.r((template.default || template).___typeName, function () {
return Component;
});
}