forked from nodejs/undici
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tree-shake node bundle (nodejs#1187)
* tree-shake node bundle * Update index-fetch.js Co-authored-by: Robert Nagy <ronagy@icloud.com>
- Loading branch information
1 parent
80a1dab
commit d785342
Showing
3 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,3 +75,6 @@ yarn.lock | |
corpus/ | ||
crash-* | ||
fuzz-results-*.json | ||
|
||
# Bundle output | ||
undici-fetch.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
'use strict' | ||
|
||
const Agent = require('./lib/agent') | ||
|
||
const globalDispatcher = new Agent() | ||
|
||
const fetchImpl = require('./lib/fetch') | ||
module.exports.fetch = async function fetch (resource, init) { | ||
return fetchImpl.call(globalDispatcher, resource, init) | ||
} | ||
module.exports.FormData = require('./lib/fetch/formdata').FormData | ||
module.exports.Headers = require('./lib/fetch/headers').Headers | ||
module.exports.Response = require('./lib/fetch/response').Response | ||
module.exports.Request = require('./lib/fetch/request').Request | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters