Skip to content

Commit

Permalink
Fix ESM builds (#759)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasio committed May 7, 2024
1 parent 1a2fef3 commit 399af78
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .changeset/sweet-parrots-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@headstartwp/core": patch
"@headstartwp/next": patch
---

Make ESM builds ESM compatible
116 changes: 112 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
],
"sideEffects": false,
"scripts": {
"postbuild": "node ../../scripts/package.js",
"postbuild": "tsc-esm-fix --target dist/mjs && node ../../scripts/package.js",
"build": "npm run ts && npm run ts:cjs",
"ts:cjs": "tsc -b tsconfig-cjs.json",
"ts": "tsc -b",
Expand All @@ -60,7 +60,8 @@
"msw": "^0.35.0",
"ts-jest": "^29.0.3",
"typescript": "^5.0.4",
"whatwg-fetch": "^3.6.2"
"whatwg-fetch": "^3.6.2",
"tsc-esm-fix": "^2.20.27"
},
"dependencies": {
"@justinribeiro/lite-youtube": "^1.3.1",
Expand Down
5 changes: 3 additions & 2 deletions packages/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
],
"sideEffects": false,
"scripts": {
"postbuild": "node ../../scripts/package.js",
"postbuild": "tsc-esm-fix --target dist/mjs && node ../../scripts/package.js",
"build": "npm run ts && npm run ts:cjs",
"ts:cjs": "tsc -b tsconfig-cjs.json",
"ts": "tsc -b",
Expand Down Expand Up @@ -67,7 +67,8 @@
"ts-jest": "^29.0.1",
"typescript": "^5.0.4",
"whatwg-fetch": "^3.6.2",
"jest-fetch-mock": "^3.0.3"
"jest-fetch-mock": "^3.0.3",
"tsc-esm-fix": "^2.20.27"
},
"peerDependencies": {
"next": ">= 12.0.0",
Expand Down

0 comments on commit 399af78

Please sign in to comment.