core-js
https://github.com/zloirock/core-js
babel
が
babel-polyfill
で使っている次期
JavaScript
の関数の実装部分
古いブラウザで
Array.prototype.find
や
Array.prototype.includes
を使うためにcore-jsを個別に読み込む
code:polyfill.js
import 'babel-regenerator-runtime'
import 'core-js/fn/array/find'
import 'core-js/fn/array/includes'
babel-polyfill
をそのまま読み込むと150kbぐらい増えて重いのでこうした
core-js個別に読むと12kb増えた
babel-regenerator-runtime
は
async-await
に必要