Skip to content

Commit

Permalink
how to bundle-analyzer with next-compose-plugins (#15370)
Browse files Browse the repository at this point in the history
Added a section in readme with the proper use of the plugin with next-compose-plugins ^2.0.0, otherwise it doesn't work
  • Loading branch information
cargallo authored Aug 16, 2020
1 parent 2cb05b5 commit aec37fa
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/next-bundle-analyzer/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,18 @@ ANALYZE=true yarn build
```

When enabled two HTML files (client.html and server.html) will be outputted to `<distDir>/analyze/`. One will be for the server bundle, one for the browser bundle.

### Usage with next-compose-plugins

From version 2.0.0 of next-compose-plugins you need to call bundle-analyzer in this way to work

```js
const withPlugins = require('next-compose-plugins')
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})
module.exports = withPlugins([
[withBundleAnalyzer({})],
// your other plugins here
])
```

0 comments on commit aec37fa

Please sign in to comment.