node-XMLHttpRequest
node-XMLHttpRequest copied to clipboard
Add a browser specific entry point to work with browserify/webpack.
When having code that is shared with the browser, it would be great if we could have a browser specific entry point that just returned the window.XMLHttpRequest
object.
Both browserify and webpack can read a "browser"
field on the module's package.json
that defines a new entry point to use when bundling, as described on this spec.
Otherwise, it's necessary to explicitly avoid bundling the module and add some conditional logic to use the browser's XMLHttpRequest
instead.
I can create a pull request to add this improvement.
+1 Please.
Looks like a simple pull-request for this (#66) was created a year before this issue was created, and even that wasn't merged.
I ended up going for superagent, a few hours later. Glad someone else did it though ;).