You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Barrel files are "index.ts" files within folders that reexport code.
In the context of the Next.js app (not packages, bundling them is a different subject), barrel file might lead to pages not being tree-shaken correctly. Eg if page A uses "core/components" a,b,c, and page B uses "core/components" d and e, page B might still have the code of components a,b,c, and pge A the components d and e.
Using "sideEffects": false in app package.json seems to improve that but may have unintended consequences. It's also possible to tweak the Webpack config to indicate which index.ts files are sideEffects free more precisely (eg React components)
Barrel files are "index.ts" files within folders that reexport code.
In the context of the Next.js app (not packages, bundling them is a different subject), barrel file might lead to pages not being tree-shaken correctly. Eg if page A uses "core/components" a,b,c, and page B uses "core/components" d and e, page B might still have the code of components a,b,c, and pge A the components d and e.
Using "sideEffects": false in app package.json seems to improve that but may have unintended consequences. It's also possible to tweak the Webpack config to indicate which index.ts files are sideEffects free more precisely (eg React components)
See vercel/next.js#12557
Trying "sideEffects": false in package.json didn't have any noticeable effect in Devographics surveyform a this point.
The text was updated successfully, but these errors were encountered: