diff --git a/packages/next-bundle-analyzer/readme.md b/packages/next-bundle-analyzer/readme.md index 5ddf2b8f08275d..1436cb23c8030f 100644 --- a/packages/next-bundle-analyzer/readme.md +++ b/packages/next-bundle-analyzer/readme.md @@ -41,3 +41,18 @@ ANALYZE=true yarn build ``` When enabled two HTML files (client.html and server.html) will be outputted to `/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 +]) +```