node-XMLHttpRequest icon indicating copy to clipboard operation
node-XMLHttpRequest copied to clipboard

Add a browser specific entry point to work with browserify/webpack.

Open santiagoaguiar opened this issue 10 years ago • 3 comments

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.

santiagoaguiar avatar Nov 26 '14 23:11 santiagoaguiar

+1 Please.

ibc avatar Dec 22 '14 19:12 ibc

Looks like a simple pull-request for this (#66) was created a year before this issue was created, and even that wasn't merged.

dchambers avatar Mar 15 '15 21:03 dchambers

I ended up going for superagent, a few hours later. Glad someone else did it though ;).

santiagoaguiar avatar Mar 15 '15 23:03 santiagoaguiar