diff --git a/packages/react-scripts/config/polyfills.js b/packages/react-scripts/config/polyfills.js index 673fb8399b4..c6c00d69a7c 100644 --- a/packages/react-scripts/config/polyfills.js +++ b/packages/react-scripts/config/polyfills.js @@ -22,3 +22,12 @@ require('whatwg-fetch'); // Object.assign() is commonly used with React. // It will use the native implementation if it's present and isn't buggy. Object.assign = require('object-assign'); + +// React depends on collection types Map and Set starting in version 16. +// We will include these dependencies explicitly until specified versions of +// browsers may be targeted. +require('core-js/es6/map'); +require('core-js/es6/set'); + +// React also depends on requestAnimationFrame in version 16 and newer. +require('raf/polyfill'); diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 123f966d035..5458c553f82 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -30,6 +30,7 @@ "babel-runtime": "6.26.0", "case-sensitive-paths-webpack-plugin": "2.1.1", "chalk": "1.1.3", + "core-js": "2.5.1", "css-loader": "0.28.4", "dotenv": "4.0.0", "eslint": "4.4.1", @@ -48,6 +49,7 @@ "postcss-flexbugs-fixes": "3.2.0", "postcss-loader": "2.0.6", "promise": "8.0.1", + "raf": "3.3.2", "react-dev-utils": "^4.1.0", "style-loader": "0.18.2", "sw-precache-webpack-plugin": "0.11.4", @@ -58,8 +60,8 @@ "whatwg-fetch": "2.0.3" }, "devDependencies": { - "react": "^15.5.4", - "react-dom": "^15.5.4" + "react": "^16.0.0", + "react-dom": "^16.0.0" }, "optionalDependencies": { "fsevents": "1.1.2"