Currently, I am tackling the challenge of minimizing bundle sizes in my Next.js project. One particular aspect that caught my attention is the inclusion of a core-js
bundle for polyfills. This adds an extra 50KB to the size of the main bundle, which I aim to eliminate.
In pursuit of this optimization, I experimented with customizing the babel configuration as follows:
{
"presets": [
[
"next/babel",
{
"useBuiltIns": "usage",
"corejs": "3"
}
]
]
}
Regrettably, this approach did not yield the desired results.
I seek advice on how to successfully remove the corejs from my Next.js project. Any guidance or suggestions would be highly valued and appreciated.
Thank you in advance.