Urgent.News

What's breaking now, across thousands of outlets.

Tech

What Browserslist Actually Does in Next.js

We set up three near-identical Next.js 16 projects to answer a simple question: if you set a browserslist target in package.json , does the build change to match it? We tested three targets ( ie 11 , chrome 116 , about 3 years old, and chrome 139 , about 1 year old) and compared the compiled output byte by byte. The code for all three projects is on GitHub: ale-grosselle/nextjs-browserlist-test .…

The experiment aimed to determine if setting a browserslist target in Next.js' package.json file would alter the build to match the specified target. Three Next.js 16 projects were created with minimal differences: all using the summarize() function to analyze browsers, and only the browserslist field varying between projects. The browserslist fields represented three different targets: ie 11, chrome 116 (3 years old), and chrome 139 (1 year old).

Both the JavaScript and CSS components of the project were analyzed using the same summarize() function across the builds. The results revealed that the IE11 build transpiled to ES5, while the other two builds produced identical outcomes. This indicates that browserslist targets within Next.js projects do indeed affect the output, with the extent of the change varying depending on the specified target.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Unity_access, major updates and release status

****For the past 2-3 weeks I have been working on Unity_access. For those that do not know, Unity_access is a plugin for the Unity Editor that makes the previously inaccessible Editor more screen…

More from Monday 31 August →