Skip to content

Commit 08448c1

Browse files
committed
fix: add types conditions to package exports for nodenext resolution
TypeScript with moduleResolution nodenext/node16 ignores the top-level "types" field when an "exports" map is present. Without a "types" condition inside each export, consumers got TS7016 "Could not find a declaration file for module 'sql-render'".
1 parent b0a09cc commit 08448c1

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sql-render",
3-
"version": "0.3.1",
3+
"version": "0.3.2",
44
"description": "Type-safe {{variable}} templating for .sql files with built-in injection protection",
55
"author": "bug3",
66
"repository": {
@@ -16,8 +16,14 @@
1616
"types": "./dist/index.d.ts",
1717
"exports": {
1818
".": {
19-
"import": "./dist/index.mjs",
20-
"require": "./dist/index.cjs"
19+
"import": {
20+
"types": "./dist/index.d.mts",
21+
"default": "./dist/index.mjs"
22+
},
23+
"require": {
24+
"types": "./dist/index.d.ts",
25+
"default": "./dist/index.cjs"
26+
}
2127
}
2228
},
2329
"files": [

0 commit comments

Comments
 (0)