Browserslist Targets Have Little Effect on Next.js JS Output, Tests Show
A developer experiment compared three near-identical Next.js projects configured with different browserslist targets — IE 11, Chrome 116, and Chrome 139 — to see whether the build output would differ. Using a TypeScript function that relied on modern JavaScript features like optional chaining, logical assignment, and ES2022 array methods, the team compiled each project and compared the emitted chunks. The IE 11 build was genuinely transpiled to ES5 by Next.js's SWC compiler, stripping arrow functions, replacing let/const, and rewriting modern syntax as older equivalents. However, the Chrome 116 and Chrome 139 builds produced byte-for-byte identical output, with no syntax downleveling applied despite the two-year gap between those browser targets. The findings suggest that Next.js's SWC compiler does not meaningfully differentiate between modern browserslist targets beyond a broad modern-versus-legacy threshold.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in