Skip to content

Commit

Permalink
fix: runtime loading in native esm
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Nov 10, 2023
1 parent 63fb73a commit 84f443d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
7 changes: 7 additions & 0 deletions .changeset/many-owls-smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@marko/translator-default": patch
"marko": patch
"@marko/compiler": patch
---

Fix issue when the Marko hot-reload runtime is loaded in native esm
4 changes: 1 addition & 3 deletions packages/marko/src/runtime/html/hot-reload.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var runtime = require(".");
var createTemplate = runtime.t;
var registered = {};

runtime.t = function (typeName) {
exports.t = runtime.t = function (typeName) {
if (registered[typeName]) {
return registered[typeName];
}
Expand All @@ -24,5 +24,3 @@ runtime.t = function (typeName) {
return renderFn.apply(this, arguments);
}
};

module.exports = runtime;
4 changes: 1 addition & 3 deletions packages/marko/src/runtime/vdom/hot-reload.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var registered = {};
var instancesByType = {};
var queue;

runtime.t = function (typeName) {
exports.t = runtime.t = function (typeName) {
if (registered[typeName]) {
return registered[typeName];
}
Expand Down Expand Up @@ -113,5 +113,3 @@ function batchUpdate() {
}
});
}

module.exports = runtime;

0 comments on commit 84f443d

Please sign in to comment.