-
Notifications
You must be signed in to change notification settings - Fork 38
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
Support webpack with node environments (e.g. electron) #239
Conversation
I agree this PR, too! :)
|
What's it going to take to make this happen? |
Thanks for the PR and your patience. This PR will need a test To prevent a regression before it’s admitted. |
I added the following to package.json scripts section:
Which results in all tests passing except for the Promise context one... I don't fully understand what's going on there though.
|
|
…with added support for tests
See #250 for included testing. Or I'm okay with those changes being brought over to this PR. I'm a bit of a github forking/PR novice so sorry about that. |
The whole point of Also I think it's bad style to just take someone else's code and put it in your own PR - even though it's just one little line. I'm currently working on fixing the code so it actually passes the test. |
Guess it looks good now 😄 |
Looks good! It looks like the files touched have changed mode from 100644 to 100755 (they've become executable). Can you see if you can change those back? Following that I'll merge and publish a version. |
@camhart in the future there are two approaches I can think of which you can use with GitHub to keep everything properly attributed. One is to clone a repo, add @d-fischer's fork as a remote and check out the branch, append commits, push to your fork, and then PR the branch on your fork. Authorship of commits should be retained, and if your PR gets merged the earlier PR is automatically closed. This is a method which works if the author of the original PR is perhaps slow to respond, which is not the case here. The second approach is arguably better since it engages the original author. You make a pull request to the branch on their fork with the commits you want added. If/when that PR is merged this PR would automatically be updated with the new commits and tests re-run. |
Ah yes, good old WSL and its executable flags everywhere. Fixed. |
Nice work with this, and thanks again for your patience. |
Published as v6.1.1. |
It seems like webpack resolves
node-fetch
as its ESM version, which contains the method as thedefault
member rather than the root export. This change should gracefully handle that while still preserving the other exports (Request, Response, Headers).Tested in electron 8.0.1, with and without webpack 4.41.6, both work now.
I'd recommend to publish this as a patch version (6.1.1).