Skip to content

Use this package with @next/bundle-analyzer ? #874

Answered by aralroca
ghost asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, we are using @next/bundle-analyzer with next-translate and next-plugin-preact without any problem.

const hasBundleAnalyzer = withBundleAnalyzer({
  analyzeServer: ['server', 'both'].includes(process.env.BUNDLE_ANALYZE),
  analyzeBrowser: ['browser', 'both'].includes(process.env.BUNDLE_ANALYZE),
  bundleAnalyzerConfig: {
    server: {
      analyzerMode: 'static',
      reportFilename: 'server.html',
    },
    browser: {
      analyzerMode: 'static',
      reportFilename: 'client.html',
    },
  },
  ...config,
})

module.exports = nextTranslate(withPreact(hasBundleAnalyzer))

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ghost
Comment options

Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #871 on June 29, 2022 22:22.