Skip to content

Commit a0c099b

Browse files
authored
fix: Add support for TS 4.7+ node16/next module
in TS 4.7+, TS introduced a node16/next module mode. in this mode, if libraries are using "exports" field on package.json, each "exports" field needs "types" field, or fail to load typings. for more information, see release note: https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#esm-nodejs
1 parent 764f70d commit a0c099b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@
88
"unpkg": "./dist/react-intersection-observer.umd.js",
99
"types": "./dist/index.d.ts",
1010
"exports": {
11-
"./test-utils": "./dist/test-utils.js",
11+
"./test-utils": {
12+
"types": "./dist/test-utils.d.ts",
13+
"default": "./dist/test-utils.js"
14+
},
1215
".": {
16+
"types": "./dist/index.d.ts",
1317
"require": "./dist/react-intersection-observer.js",
1418
"default": "./dist/react-intersection-observer.modern.mjs"
1519
}

0 commit comments

Comments
 (0)