This example shows how to analyze the output bundles using @next/bundle-analyzer
Deploy the example using Vercel or preview live with StackBlitz
Execute create-next-app
with npm, Yarn, or pnpm to bootstrap the example:
npx create-next-app --example analyze-bundles analyze-bundles-app
yarn create next-app --example analyze-bundles analyze-bundles-app
pnpm create next-app --example analyze-bundles analyze-bundles-app
To analyze your webpack output, invoke the following command:
npm run analyze
# or
yarn analyze
Once the build is completed, you can inspect the bundle by running:
npm run serve
# or
yarn serve