Skip to content

Commit 4a917e5

Browse files
committed
feat: add explicit /native subpath
1 parent f46566f commit 4a917e5

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

lib/native.cjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const nodeFetch = require("../dist/native.cjs");
2+
3+
function fetch(input, options) {
4+
return nodeFetch.fetch(input, options);
5+
}
6+
7+
for (const key in nodeFetch) {
8+
fetch[key] = nodeFetch[key];
9+
}
10+
11+
module.exports = fetch;

package.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@
5959
"default": "./dist/node.cjs"
6060
}
6161
},
62+
"./native": {
63+
"import": {
64+
"types": "./lib/index.d.mts",
65+
"default": "./dist/native.mjs"
66+
},
67+
"require": {
68+
"types": "./lib/index.d.cts",
69+
"default": "./lib/native.cjs"
70+
}
71+
},
6272
"./src/index.js": {
6373
"import": {
6474
"types": "./lib/index.d.mts",
@@ -101,4 +111,4 @@
101111
"vitest": "^0.34.2"
102112
},
103113
"packageManager": "[email protected]"
104-
}
114+
}

0 commit comments

Comments
 (0)