mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-03-26 22:39:31 +08:00
Don't polyfill fetch for Node (#5132)
This commit is contained in:
8
packages/react-app-polyfill/jsdom.js
vendored
8
packages/react-app-polyfill/jsdom.js
vendored
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user