--- title: Bundle Analysis description: How to analyze and optimize your app's bundle size product: Next Config type: guide summary: How to analyze and optimize your app's bundle size. related: - /en/docs/packages/next-config/overview --- # Bundle Analysis kreogen uses [@next/bundle-analyzer](https://www.npmjs.com/package/@next/bundle-analyzer) to analyze and optimize your app's bundle size. Each app has a `next.config.ts` file that is configured to use the analyzer when the `ANALYZE` environment variable is set to `true`. ## Usage To run the analyzer, simply run the following command from the root of the project: ```sh title="Terminal" bun run analyze ``` Turborepo will automatically run the analyzer for each app when the command is executed. Once the bundle analyzer finishes running for each app, it will open three HTML files in your default browser automatically: `client`, `nodejs` and `edge`. Each one shows a treemap, describing the size and impact of modules loaded on that particular environment. You can then work on optimizing your app by removing or dynamically loading the heaviest modules. --- For a semantic overview of all documentation, see [/sitemap.md](/sitemap.md) For an index of all available documentation, see [/llms.txt](/llms.txt)