Demonstrates how importing a module in _app.js
does not automatically move it into the commons.js bundle. _app.js
seems to be treated like any other page with respect to code splitting — that is if under half of pages use a module, it is individually included in each page's bundle.
This doesn't make sense, since _app.js
is run for every page.
To repro,
- Clone this repo
yarn build
will open Webpack Bundle Analyzer pages in your browser
On the client bundle analysis, observe how the @sentry
module is in both the _app.js
bundle and the index.js
bundle.