Skip to content

Commit

Permalink
fix cjs export (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Mar 22, 2023
1 parent 7a8b590 commit a0546fe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/clever-ghosts-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'preact-render-to-string': patch
---

Fix CJS export
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,23 @@
"version": "5.2.6",
"description": "Render JSX to an HTML string, with support for Preact components.",
"main": "dist/index.js",
"umd:main": "dist/index.js",
"umd:main": "dist/index.umd.js",
"module": "dist/index.module.js",
"jsnext:main": "dist/index.module.js",
"types": "src/index.d.ts",
"exports": {
".": {
"types": "./src/index.d.ts",
"import": "./dist/index.mjs",
"browser": "./dist/index.module.js",
"umd": "./dist/index.umd.js",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./jsx": {
"types": "./jsx.d.ts",
"import": "./dist/jsx.mjs",
"browser": "./dist/jsx.module.js",
"umd": "./dist/jsx.umd.js",
"import": "./dist/jsx.mjs",
"require": "./dist/jsx.js"
},
"./package.json": "./package.json"
Expand All @@ -28,7 +30,7 @@
"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",
"build": "npm run -s transpile && npm run -s transpile:jsx && npm run -s copy-typescript-definition",
"postbuild": "node ./config/node-13-exports.js && node ./config/node-commonjs.js",
"transpile": "microbundle src/index.js -f es,umd --target web --external preact",
"transpile": "microbundle src/index.js -f es,cjs,umd --target web --external preact",
"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",
"copy-typescript-definition": "copyfiles -f src/*.d.ts dist",
"test": "eslint src test && tsc && npm run test:mocha && npm run test:mocha:compat && npm run test:mocha:debug && npm run bench",
Expand Down

0 comments on commit a0546fe

Please sign in to comment.