Update babel to 7.5, and actually enable polyfills

@babel/polyfill is deprecated in ≥ 7.4 [1], and we never actually used
it as we forgot to import it [2]. Move to core-js/stable.

[1] https://babeljs.io/blog/2019/03/19/7.4.0#migration-from-core-js-2
[2] https://babeljs.io/docs/en/babel-polyfill#usage-in-node-browserify-webpack
This commit is contained in:
Martin Pitt 2019-07-11 13:39:32 +02:00 committed by Katerina Koukiou
parent 1fc1923021
commit 8fab928dcb
2 changed files with 5 additions and 3 deletions

View file

@ -13,8 +13,8 @@
"eslint:fix": "eslint --fix --ext .js --ext .jsx src/" "eslint:fix": "eslint --fix --ext .js --ext .jsx src/"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.0.0", "@babel/core": "^7.5.4",
"@babel/preset-env": "^7.0.0", "@babel/preset-env": "^7.5.4",
"@babel/preset-react": "^7.0.0", "@babel/preset-react": "^7.0.0",
"babel-eslint": "^9.0.0", "babel-eslint": "^9.0.0",
"babel-loader": "^8.0.0", "babel-loader": "^8.0.0",
@ -43,7 +43,7 @@
"webpack-cli": "^3.1.0" "webpack-cli": "^3.1.0"
}, },
"dependencies": { "dependencies": {
"@babel/polyfill": "7.4.4", "core-js": "^3.1.4",
"node-sass": "4.12.0", "node-sass": "4.12.0",
"react": "16.8.6", "react": "16.8.6",
"react-dom": "16.8.6" "react-dom": "16.8.6"

View file

@ -17,6 +17,8 @@
* along with Cockpit; If not, see <http://www.gnu.org/licenses/>. * along with Cockpit; If not, see <http://www.gnu.org/licenses/>.
*/ */
import "core-js/stable";
import React from 'react'; import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import { Application } from './app.jsx'; import { Application } from './app.jsx';