Skip to content

Commit 914858c

Browse files
Publish dual ESM/CJS package
1 parent 43bf1ef commit 914858c

File tree

3 files changed

+823
-1
lines changed

3 files changed

+823
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## v0.2.0 - 2022-09-09
4+
5+
- Publish as a dual ESM/CJS package
6+
37
## v0.1.0 - 2022-09-01
48

59
- Initial release

package.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
"author": "Jacob Gillespie <[email protected]>",
88
"license": "MIT",
99
"main": "./dist/index.js",
10+
"module": "./dist/index.mjs",
11+
"exports": {
12+
".": {
13+
"import": "./dist/index.mjs",
14+
"require": "./dist/index.js",
15+
"types": "./dist/index.d.ts"
16+
},
17+
"./package.json": "./package.json"
18+
},
1019
"types": "./dist/index.d.ts",
1120
"files": [
1221
"dist"
@@ -19,7 +28,7 @@
1928
"serverless"
2029
],
2130
"scripts": {
22-
"build": "tsc",
31+
"build": "tsup src/index.ts --format cjs,esm --dts --clean",
2332
"clean": "rm -rf dist",
2433
"fmt": "prettier --write .",
2534
"fmt:check": "prettier --check .",
@@ -41,6 +50,7 @@
4150
"prettier": "^2.7.1",
4251
"prettier-plugin-organize-imports": "^3.1.0",
4352
"prettier-plugin-pkg": "^0.17.1",
53+
"tsup": "^6.2.3",
4454
"typescript": "^4.8.2"
4555
},
4656
"sideEffects": false

0 commit comments

Comments
 (0)