mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-01-12 22:46:30 +08:00
Don't polyfill fetch for Node -- additional files (#5789)
This commit is contained in:
committed by
Joe Haddad
parent
1d8d9eaaee
commit
0c9c97a778
8
packages/react-app-polyfill/ie11.js
vendored
8
packages/react-app-polyfill/ie11.js
vendored
@@ -14,8 +14,12 @@ if (typeof Promise === 'undefined') {
|
||||
window.Promise = require('promise/lib/es6-extensions.js');
|
||||
}
|
||||
|
||||
// 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');
|
||||
}
|
||||
|
||||
// Object.assign() is commonly used with React.
|
||||
// It will use the native implementation if it's present and isn't buggy.
|
||||
|
||||
8
packages/react-app-polyfill/ie9.js
vendored
8
packages/react-app-polyfill/ie9.js
vendored
@@ -14,8 +14,12 @@ if (typeof Promise === 'undefined') {
|
||||
window.Promise = require('promise/lib/es6-extensions.js');
|
||||
}
|
||||
|
||||
// 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');
|
||||
}
|
||||
|
||||
// Object.assign() is commonly used with React.
|
||||
// It will use the native implementation if it's present and isn't buggy.
|
||||
|
||||
Reference in New Issue
Block a user