Skip to content

Commit 605de78

Browse files
authored
fix: improve compatibility with node16 module resolution (#1595)
Related: - microsoft/TypeScript#46770 (comment) - #1589
1 parent d00ccd2 commit 605de78

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

Diff for: package.json

+13-4
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,25 @@
2222
"./dist/socket.io.js": "./dist/socket.io.js",
2323
"./dist/socket.io.js.map": "./dist/socket.io.js.map",
2424
".": {
25-
"types": "./build/esm/index.d.ts",
2625
"import": {
26+
"types": "./build/esm/index.d.ts",
2727
"node": "./build/esm-debug/index.js",
2828
"default": "./build/esm/index.js"
2929
},
30-
"require": "./build/cjs/index.js"
30+
"require": {
31+
"types": "./build/cjs/index.d.ts",
32+
"default": "./build/cjs/index.js"
33+
}
3134
},
3235
"./debug": {
33-
"import": "./build/esm-debug/index.js",
34-
"require": "./build/cjs/index.js"
36+
"import": {
37+
"types": "./build/esm/index.d.ts",
38+
"default": "./build/esm-debug/index.js"
39+
},
40+
"require": {
41+
"types": "./build/cjs/index.d.ts",
42+
"default": "./build/cjs/index.js"
43+
}
3544
}
3645
},
3746
"types": "./build/esm/index.d.ts",

Diff for: tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"outDir": "build/cjs/",
44
"target": "es2018", // Node.js 10 (https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping)
55
"module": "commonjs",
6-
"declaration": false,
6+
"declaration": true,
77
"esModuleInterop": true
88
},
99
"include": [

0 commit comments

Comments
 (0)