Skip to content

Commit 5d893d5

Browse files
fix: cjs and esm exports
1 parent 966f41a commit 5d893d5

File tree

4 files changed

+4
-13
lines changed

4 files changed

+4
-13
lines changed

packages/html/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,4 +526,3 @@ exports.contentToString = contentToString;
526526
exports.Fragment = Fragment;
527527
//@ts-expect-error - global augmentation
528528
exports.Html = { ...exports };
529-
exports.default = exports.Html;

packages/html/register.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,5 @@ try {
1515

1616
// Avoids multiple registrations
1717
if (!root.Html) {
18-
root.Html = require('./index');
19-
}
20-
21-
// Removes the default export wrapper
22-
if (root.Html.default) {
23-
root.Html = root.Html.default;
18+
root.Html = require('./index').Html;
2419
}

packages/html/test/misc.test.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,9 @@ describe('Miscellaneous', () => {
116116
);
117117

118118
assert.throws(
119+
//prettier-ignore
119120
//@ts-expect-error - should warn about invalid child
120-
() => (
121-
<div>
122-
{{}} {{}}
123-
</div>
124-
),
121+
() => (<div>{{}} {{}}</div>),
125122
/Objects are not valid as a KitaJSX child/
126123
);
127124
});

packages/html/test/register.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('Global instance', () => {
1818

1919
// Literally the same object
2020
assert.equal(typeof Html, 'object');
21-
assert.ok(Html === HtmlModule);
21+
assert.deepStrictEqual(Html, HtmlModule.Html);
2222

2323
// @ts-expect-error - Delete globalThis to test that it is added
2424
delete globalThis.Html;

0 commit comments

Comments
 (0)