Reputation: 3967
In the npm page for whatwg-fetch
it says:
Importing will automatically polyfill window.fetch and related APIs:
import 'whatwg-fetch' window.fetch(...)
Below that in the same section it says
For use with webpack, add this package in the entry configuration option before your application entry point:
entry: ['whatwg-fetch', ...]
I use webpack
.
Should I both import it and add it as an entry, or is the entry enough?
Upvotes: 2
Views: 3902
Reputation: 6841
One or the other, they will produce the same output anyways. I suggest importing in your entry point other than adding on the entry array on your webpack configuration.
Upvotes: 5