Skip to content

Commit

Permalink
Update bundle analyzer readme (#27507)
Browse files Browse the repository at this point in the history
Follow-up to #27463 this adds a note about installing as `devDependency` instead of changing the default install command as the plugin being a `devDependency` might cause issues unless wrapped in a `process.env` check. 


## Documentation / Examples

- [x] Make sure the linting passes
  • Loading branch information
ijjk authored Jul 26, 2021
1 parent f22f884 commit b25a983
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/next-bundle-analyzer/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ Use `webpack-bundle-analyzer` in your Next.js project
## Installation

```
npm install -D @next/bundle-analyzer
npm install @next/bundle-analyzer
```

or

```
yarn add --dev @next/bundle-analyzer
yarn add @next/bundle-analyzer
```

Note: if installing as a `devDependency` make sure to wrap the require in a `process.env` check as `next.config.js` is loaded during `next start` as well.

### Usage with environment variables

Create a next.config.js (and make sure you have next-bundle-analyzer set up)
Expand Down

0 comments on commit b25a983

Please sign in to comment.