Skip to content

Commit 098ef2c

Browse files
fs-eirerachguo
authored and
rachguo
committed
[js/web] fix types exports in package.json (#19458)
### Description Since TypeScript v4.7, types need to specify inside "exports" field when it is available. This PR appends types just before each "default" (which is required by spec to be the last item). Fixes #19403.
1 parent c1ce74d commit 098ef2c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

js/web/package.json

+10
Original file line numberDiff line numberDiff line change
@@ -69,46 +69,56 @@
6969
"exports": {
7070
".": {
7171
"node": "./dist/ort.node.min.js",
72+
"types": "./types.d.ts",
7273
"default": {
7374
"import": "./dist/esm/ort.min.js",
7475
"require": "./dist/cjs/ort.min.js",
76+
"types": "./types.d.ts",
7577
"default": {
7678
"development": "./dist/ort.js",
79+
"types": "./types.d.ts",
7780
"default": "./dist/ort.min.js"
7881
}
7982
}
8083
},
8184
"./experimental": {
8285
"import": "./dist/esm/ort.all.min.js",
8386
"require": "./dist/cjs/ort.all.min.js",
87+
"types": "./types.d.ts",
8488
"default": {
8589
"development": "./dist/ort.all.js",
90+
"types": "./types.d.ts",
8691
"default": "./dist/ort.all.min.js"
8792
}
8893
},
8994
"./wasm": {
9095
"import": "./dist/esm/ort.wasm.min.js",
9196
"require": "./dist/cjs/ort.wasm.min.js",
97+
"types": "./types.d.ts",
9298
"default": "./dist/ort.wasm.min.js"
9399
},
94100
"./wasm-core": {
95101
"import": "./dist/esm/ort.wasm-core.min.js",
96102
"require": "./dist/cjs/ort.wasm-core.min.js",
103+
"types": "./types.d.ts",
97104
"default": "./dist/ort.wasm-core.min.js"
98105
},
99106
"./webgl": {
100107
"import": "./dist/esm/ort.webgl.min.js",
101108
"require": "./dist/cjs/ort.webgl.min.js",
109+
"types": "./types.d.ts",
102110
"default": "./dist/ort.webgl.min.js"
103111
},
104112
"./webgpu": {
105113
"import": "./dist/esm/ort.webgpu.min.js",
106114
"require": "./dist/cjs/ort.webgpu.min.js",
115+
"types": "./types.d.ts",
107116
"default": "./dist/ort.webgpu.min.js"
108117
},
109118
"./training": {
110119
"import": "./dist/esm/ort.training.wasm.min.js",
111120
"require": "./dist/cjs/ort.training.wasm.min.js",
121+
"types": "./types.d.ts",
112122
"default": "./dist/ort.training.wasm.min.js"
113123
}
114124
},

0 commit comments

Comments
 (0)