Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
santiagoaguiar opened this issue Nov 26, 2014 · 3 comments

Comments

@santiagoaguiar
Copy link

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.

@ibc
Copy link

ibc commented Dec 22, 2014

+1
Please.

@dchambers
Copy link

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

@santiagoaguiar
Copy link
Author

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

acinader pushed a commit to acinader/node-XMLHttpRequest that referenced this issue Mar 2, 2016
Tell webpack to mock fs and child_process when packaging for the browser.

This will fix driverdan#89 and is lighter-weight than driverdan#66.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants