rsnext/examples/analyze-bundles
Max Proske 1648064d0e
Convert analyze-bundles example to TypeScript (#38040)
Converted Next.js Bundle Analyzer example over to TypeScript to align with the Examples guide.

I also replaced `faker` with `@faker-js/faker`. Faker has been forked and maintained [here](https://github.com/faker-js/faker) after the original author [deleted](https://www.theverge.com/2022/1/9/22874949/developer-corrupts-open-source-libraries-projects-affected) the library.

## Documentation / Examples

- [X] Make sure the linting passes by running `pnpm lint`
- [X] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-06-27 00:32:37 +00:00
..
pages Convert analyze-bundles example to TypeScript (#38040) 2022-06-27 00:32:37 +00:00
.gitignore Added .gitignore to examples that are deployed to vercel (#15127) 2020-07-16 10:52:23 -04:00
next-env.d.ts Convert analyze-bundles example to TypeScript (#38040) 2022-06-27 00:32:37 +00:00
next.config.js Convert analyze-bundles example to TypeScript (#38040) 2022-06-27 00:32:37 +00:00
package.json Convert analyze-bundles example to TypeScript (#38040) 2022-06-27 00:32:37 +00:00
README.md Update pnpm create next-app for latest pnpm 6 and 7 (#37254) 2022-05-27 21:21:40 +00:00
tsconfig.json Convert analyze-bundles example to TypeScript (#38040) 2022-06-27 00:32:37 +00:00

Analyzer Bundles example

This example shows how to analyze the output bundles using @next/bundle-analyzer

Deploy your own

Deploy the example using Vercel or preview live with StackBlitz

Deploy with Vercel

How to use

Execute create-next-app with npm, Yarn, or pnpm to bootstrap the example:

npx create-next-app --example analyze-bundles analyze-bundles-app
# or
yarn create next-app --example analyze-bundles analyze-bundles-app
# or
pnpm create next-app --example analyze-bundles analyze-bundles-app

Analyze webpack output

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