Skip to content

Commit

Permalink
Merge pull request #64 from ivandotv/fix-cjs-types-issue
Browse files Browse the repository at this point in the history
Fix-cjs-types-issue
  • Loading branch information
ivandotv committed Feb 21, 2024
2 parents 2ed52bf + e2c941d commit 582bc36
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
10 changes: 10 additions & 0 deletions .changeset/few-ears-nail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'pumpit': major
---

refactor package export fields to include separate require statements.

closes Support --moduleResolution node16 in typescript #38

more info on the problem:
https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseESM.md
13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/pumpit.js",
"require": "./dist/pumpit.umd.cjs"
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/pumpit.js"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/pumpit.umd.cjs"
}
}
},
"files": [
Expand All @@ -33,7 +38,7 @@
"lint:ci": "eslint \"src/**/\"",
"test": "vitest run --coverage",
"test:watch": "vitest",
"build": "tsc && vite build",
"build": "tsc && vite build && shx cp ./dist/index.d.ts ./dist/index.d.cts",
"gen:docs": "rm -rf ./docs/api && typedoc --options typedoc.cjs --plugin typedoc-plugin-markdown",
"prepublishOnly": "pnpm build",
"prepare": "husky install",
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ export default defineConfig({
minifyWhitespace: true,
legalComments: 'none'
},
plugins: [dts()]
plugins: [dts({ rollupTypes: true })]
})

0 comments on commit 582bc36

Please sign in to comment.