Skip to content

Commit 4b627d9

Browse files
committed
Added CommonJS support
1 parent 5e70ea4 commit 4b627d9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
"name": "microdiff",
33
"version": "1.0.2",
44
"description": "Small, fast, zero dependency deep object and array comparison",
5-
"main": "./dist/index.js",
5+
"main": "./dist/index.cjs",
66
"types": "./dist/index.d.ts",
7-
"exports": "./dist/index.js",
7+
"exports": {
8+
"require": "./dist/index.cjs",
9+
"default": "./dist/index.js"
10+
},
811
"scripts": {
9-
"build": "tsc && prettier -w dist/* --loglevel warn",
12+
"build": "tsc --module CommonJS && cd dist && mv \"index.js\" \"index.cjs\" && cd ../ && tsc --module es2020 && prettier -w dist/* --loglevel warn",
1013
"test": "npm run build && uvu tests",
1114
"bench": "npm run build && node bench.js",
1215
"prepublish": "npm run build"

0 commit comments

Comments
 (0)