sindresorhus / ky

🌳 Tiny & elegant JavaScript HTTP client based on the Fetch API
MIT License
13.62k stars 363 forks source link

`browser` file is emitted on Webpack and Babel umd library build #471

Closed nugaon closed 1 year ago

nugaon commented 1 year ago

Summary

Using Webpack and Babel umd build, the library produces browser file for both browser and node environment. Even stranger is that it emits this file multiple times at node build that also causes error for the process.

You can reproduce it by cloning this repo and running npm i.

Origin story

One of our dependencies had to update this library because of the missing duplex member in the request. The library also became ESM that we tried to import into our library after which it did not work with Jest tests. Now, there are attempts to build this dependency with our stack that you can see above in order to have Jest tests.

sindresorhus commented 1 year ago

You should ask this question in the Webpack issue tracker instead. This is about Webpack, not Ky. We are just using the standard package.json exports config.