Skip to content

Commit aa3ee57

Browse files
committed
add a package.json for the preact integration to make module aliasing work
1 parent 8046009 commit aa3ee57

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"scripts": {
99
"build": "npm run -s build:main && npm run -s build:preact && npm run -s build:babel",
1010
"build:main": "microbundle src/index.mjs -f es,umd --no-sourcemap --target web",
11-
"build:preact": "microbundle src/integrations/preact.mjs -o preact/index.js -f es,umd --no-sourcemap --target web && cp src/integrations/preact.d.ts preact/index.d.ts",
11+
"build:preact": "microbundle src/integrations/preact/index.mjs -o preact/index.js -f es,umd --no-sourcemap --target web && cp src/integrations/preact/{index.d.ts,package.json} preact/",
1212
"build:babel": "microbundle src/babel.mjs -o babel/index.js -f es,cjs --target node --no-compress --no-sourcemap",
1313
"test": "eslint src/**/*.mjs test && jest test",
1414
"postpublish": "tag-dist-files --overwrite-existing-tag"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313

1414
import { h, Component, render as preactRender } from 'preact';
15-
import htm from '../index.mjs';
15+
import htm from '../../index.mjs';
1616

1717
function render(tree, parent) {
1818
preactRender(tree, parent, parent.firstElementChild);
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "htm_preact",
3+
"module": "index.mjs",
4+
"main": "index.js"
5+
}

0 commit comments

Comments
 (0)