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

Using this library in commonjs environment #231

Closed
IonicaBizau opened this issue Nov 15, 2015 · 2 comments
Closed

Using this library in commonjs environment #231

IonicaBizau opened this issue Nov 15, 2015 · 2 comments

Comments

@IonicaBizau
Copy link
Contributor

This library is 🆒!!! I'm using it in one of my projects and I want to require it in my code, bundling everything with Browserify.

The fetch.js file doesn't module.exports anything currently. I would suggest to make it export the fetch function (even it's the native one or not).

Then we could do:

var fetch = require("whatwg-fetch")

fetch(...)

Just an idea. I'm not sure if it's good to be implemented or not since the fetch function is anyway a global, but the code looks better and clearer this way than just require("whatwg-fetch") (without a variable name) in my file. 📝

Looking forward for your feedback. 😄

@IonicaBizau IonicaBizau changed the title Using in commonjs environment Using this library in commonjs environment Nov 15, 2015
@dgraham
Copy link
Contributor

dgraham commented Nov 15, 2015

See #184 (comment) for a discussion of module loaders.

@dgraham dgraham closed this as completed Nov 15, 2015
@IonicaBizau
Copy link
Contributor Author

@dgraham Ohhh, totally understand! Thanks! 😇

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants