I've started my first project in NextJs and I'm using next
and @next/bundle-analyzer
- both version 12.3.1
.
When I run in command line ANALYZE=true next build
, I receive the following output:
info - Skipping linting
info - Checking validity of types
Webpack Bundle Analyzer saved report to /(...)/.next/server/analyze/server.html
No bundles were parsed. Analyzer will show only original module sizes from stats file.
Webpack Bundle Analyzer saved report to /(...)/.next/analyze/server.html
Webpack Bundle Analyzer saved report to /(...)/.next/analyze/client.html
And in the browser are opened 3 new tabs.
.next/server/analyze/server.html
- contains the server-side modules. All good.
.next/analyze/server.html
- is a blank page, only with the sidebar on the left.
.next/analyze/client.html
- contains the client-side modules. All good.
But, according to @next/bundle-analyzer
documentation:
two HTML files (client.html and server.html) will be outputted to /analyze/.
It is not clear if I'm doing something wrong or it is just normal that @next/bundle-analyzer
produces 3 files as an output.
next.config.js
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true'
});
/** @type {import('next').NextConfig} */
module.exports = withBundleAnalyzer({
reactStrictMode: true,
experimental: {
newNextLinkBehavior: true
},
eslint: {
...
},
images: {
minimumCacheTTL: 300
}
}
Thank you.