Don't polyfill fetch for Node (#5132)

This commit is contained in:
Joe Haddad
2018-09-27 10:23:02 -04:00
committed by GitHub
parent 6510a27e8b
commit 328c3123e8

View File

@@ -6,5 +6,9 @@
*/
'use strict';
// fetch() polyfill for making API calls.
require('whatwg-fetch');
// Make sure we're in a Browser-like environment before importing polyfills
// This prevents `fetch()` from being imported in a Node test environment
if (typeof window !== 'undefined') {
// fetch() polyfill for making API calls.
require('whatwg-fetch');
}