我正在尝试通过使用https://www.npmjs.com/package/@next/bundle-analyzer来减小我网站的捆绑包大小
此刻,当我npm analyze
与
"analyze": "cross-env ANALYZE=true next build",
它没有输出具有所需可视化效果的 html 文件。
这是我的next.config.js
const withPWA = require('next-pwa')
const runtimeCaching = require('next-pwa/cache')
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})
module.exports = withPWA({
pwa: {
dest: 'public',
runtimeCaching,
},
poweredByHeader: false,
},
withBundleAnalyzer(),
)
使用这个nextjs-analyze-app-bundle 教程。
出了什么问题?