Skip to content

Commit a0546fe

Browse files
authored
fix cjs export (#285)
1 parent 7a8b590 commit a0546fe

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

.changeset/clever-ghosts-grin.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'preact-render-to-string': patch
3+
---
4+
5+
Fix CJS export

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,23 @@
44
"version": "5.2.6",
55
"description": "Render JSX to an HTML string, with support for Preact components.",
66
"main": "dist/index.js",
7-
"umd:main": "dist/index.js",
7+
"umd:main": "dist/index.umd.js",
88
"module": "dist/index.module.js",
99
"jsnext:main": "dist/index.module.js",
1010
"types": "src/index.d.ts",
1111
"exports": {
1212
".": {
1313
"types": "./src/index.d.ts",
14-
"import": "./dist/index.mjs",
1514
"browser": "./dist/index.module.js",
15+
"umd": "./dist/index.umd.js",
16+
"import": "./dist/index.mjs",
1617
"require": "./dist/index.js"
1718
},
1819
"./jsx": {
1920
"types": "./jsx.d.ts",
20-
"import": "./dist/jsx.mjs",
2121
"browser": "./dist/jsx.module.js",
22+
"umd": "./dist/jsx.umd.js",
23+
"import": "./dist/jsx.mjs",
2224
"require": "./dist/jsx.js"
2325
},
2426
"./package.json": "./package.json"
@@ -28,7 +30,7 @@
2830
"bench:v8": "BABEL_ENV=test microbundle benchmarks/index.js -f modern --alias benchmarkjs-pretty=benchmarks/lib/benchmark-lite.js --external none --target node --no-compress --no-sourcemap --raw -o benchmarks/.v8.mjs && v8 --module benchmarks/.v8.mjs",
2931
"build": "npm run -s transpile && npm run -s transpile:jsx && npm run -s copy-typescript-definition",
3032
"postbuild": "node ./config/node-13-exports.js && node ./config/node-commonjs.js",
31-
"transpile": "microbundle src/index.js -f es,umd --target web --external preact",
33+
"transpile": "microbundle src/index.js -f es,cjs,umd --target web --external preact",
3234
"transpile:jsx": "microbundle src/jsx.js -o dist/jsx.js --target web --external preact && microbundle dist/jsx.js -o dist/jsx.js -f cjs --external preact",
3335
"copy-typescript-definition": "copyfiles -f src/*.d.ts dist",
3436
"test": "eslint src test && tsc && npm run test:mocha && npm run test:mocha:compat && npm run test:mocha:debug && npm run bench",

0 commit comments

Comments
 (0)