Skip to content

Commit 46ef851

Browse files
authored
fix: improve compatibility with node16 module resolution (#711)
Related: - microsoft/TypeScript#46770 (comment) - socketio/socket.io-client#1589
1 parent 3dcb88c commit 46ef851

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

package.json

+13-3
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,24 @@
1212
"./dist/engine.io.min.js": "./dist/engine.io.min.js",
1313
".": {
1414
"import": {
15+
"types": "./build/esm/index.d.ts",
1516
"node": "./build/esm-debug/index.js",
1617
"default": "./build/esm/index.js"
1718
},
18-
"require": "./build/cjs/index.js"
19+
"require": {
20+
"types": "./build/cjs/index.d.ts",
21+
"default": "./build/cjs/index.js"
22+
}
1923
},
2024
"./debug": {
21-
"import": "./build/esm-debug/index.js",
22-
"require": "./build/cjs/index.js"
25+
"import": {
26+
"types": "./build/esm/index.d.ts",
27+
"default": "./build/esm-debug/index.js"
28+
},
29+
"require": {
30+
"types": "./build/cjs/index.d.ts",
31+
"default": "./build/cjs/index.js"
32+
}
2333
}
2434
},
2535
"types": "build/esm/index.d.ts",

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)