An audit of our compiled JavaScript bundle revealed that 34KB of gzipped code consisted of polyfills for Web APIs that have been natively supported in all modern browsers since 2021.
// vite.config.js - Targeting modern ES2022+ output:
export default defineConfig({
build: {
target: 'es2022',
// Removed: core-js/modules/es.promise.all-settled
// Removed: abortcontroller-polyfill
// Removed: array.prototype.flat
}
});
Updating the build target to ES2022 dropped the main vendor bundle by 18% with zero regression in browser error monitoring across our user base.