Skip to content

Commit

Permalink
fix (build): build with interoperability between esm and cjs with tsup
Browse files Browse the repository at this point in the history
I have tested this out on a repo by copying the new dist into the node_modules and can
confirm this solves the issues that were happening with builds for next.

see vercel/next.js#39375 for more info
  • Loading branch information
gabrielmfern committed Nov 3, 2023
1 parent 3d5058c commit bcee824
Show file tree
Hide file tree
Showing 3 changed files with 561 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node_modules
build
dist
.yarn/*
!.yarn/releases
22 changes: 18 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,30 @@
"name": "resend",
"version": "2.0.0",
"description": "Node.js library for the Resend API",
"main": "build/src/index.js",
"typings": "build/src/index.d.ts",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"build/"
"dist/**"
],
"engines": {
"node": ">=18"
},
"exports": {
".": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
},
"packageManager": "yarn@3.6.4",
"scripts": {
"build": "tsc -p .",
"build": "tsup src/index.ts --format esm,cjs --dts",
"test": "jest",
"test:watch": "jest --watch",
"lint": "eslint --fix --ext .ts ./src",
Expand Down Expand Up @@ -45,6 +58,7 @@
"prettier": "3.0.3",
"ts-jest": "29.1.1",
"ts-node": "10.9.1",
"tsup": "^7.2.0",
"typescript": "5.2.2"
}
}
Loading

0 comments on commit bcee824

Please sign in to comment.