Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Seems like fetch is not ready for ESM, see: https://gitlab.skypicker.com/incubator/universe/issues/494 kiwicom-source-id: 2c45fcd8d8291bfc4022428910260b8f7dce1355
- Loading branch information
Martin Zlámal
authored and
kiwicom-github-bot
committed
Jun 6, 2019
1 parent
6f0ba3a
commit 4b96312
Showing
4 changed files
with
9 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// @flow | ||
|
||
if (global.fetch) { | ||
module.exports = global.fetch.bind(global); | ||
} else { | ||
module.exports = require('cross-fetch'); | ||
} | ||
import fetch from 'cross-fetch'; | ||
|
||
// Dependency `cross-fetch` takes care of providing correct ponyfill for browsers, | ||
// React Native and Node.js. See: https://github.com/lquixada/cross-fetch/blob/0b198e8f3a8dc7ebad8f973d4a5bce6d00719b8e/package.json#L6-L8 | ||
export default fetch; |