UNPKG

961 BJavaScriptView Raw
1'use strict';
2
3require('core-js/es6/map')
4require('core-js/es6/set')
5require('raf/polyfill')
6require('babel-polyfill')
7
8if (typeof Promise === 'undefined') {
9 // Rejection tracking prevents a common issue where React gets into an
10 // inconsistent state due to an error, but it gets swallowed by a Promise,
11 // and the user has no idea what causes React's erratic future behavior.
12 require('promise/lib/rejection-tracking').enable();
13 window.Promise = require('promise/lib/es6-extensions.js');
14}
15
16// fetch() polyfill for making API calls.
17require('whatwg-fetch');
18
19// Object.assign() is commonly used with React.
20// It will use the native implementation if it's present and isn't buggy.
21Object.assign = require('object-assign');
22
23// In tests, polyfill requestAnimationFrame since jsdom doesn't provide it yet.
24// We don't polyfill it in the browser--this is user's responsibility.
25if (process.env.NODE_ENV === 'test') {
26 require('raf').polyfill(global);
27}