Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make webpack CommonsChunkPlugin chunking default configurable
A while ago (in vercel#1644) @arunoda updated the default for minimum refs to chunk a file into commons from the previous (which I believe was a static integer, or at least was at some point), and made it so that the file had to be used in > 50% of the pages. The problem is that people may use pages in different ways, particularly if they're using a custom server instead of the default page routing. For example, I use Styled Components, and put a `styles.js` file alongside my various page JSX files. Others may colocate JSX components inside pages, which could be very reasonable depending on the project. The point is, it's very possible to load up your /pages directory with JS files that add into the default logic's perception of "page count", since there's no singular way to determine what is and is not a page without analyzing the code within. I'd propose that leave this as the default behavior, since that makes sense if you're using Next in the OOTB manner, but allow for configuration if needed. @rauchg suggested as much in vercel#1644 but it seems like that fell out in the final version (vercel#1659)
- Loading branch information