correct import of core-js when using useBuiltins entry and browserslist

515 Views Asked by At

My webpack.config is adding core-js/stable and regenerator-runtime/runtime to the webpack config entry property:

const config = {
    name: 'client',
    target: 'web',
    entry: ['core-js/stable', 'regenerator-runtime/runtime', 'src/index'],

My babel config is using useBuiltIns: 'entry'

and I have the following .browserslistrc

>0.25%, not dead

My bundle size still looks pretty huge, I have highlighted the core-js bits in the webpack analyzer image below

enter image description here

Does babel use the browserslistrc when useBuiltins is set to entry and is there anyway I can tell that only the relevant bits of core-js are imported?

1

There are 1 best solutions below

0
On
  1. bundle size still looks pretty huge cause >0.25%, not dead need lot of polyfill.
  2. set to usage tell that only build relevant polyfill.