Socket
Book a DemoInstallSign in
Socket

@next/bundle-analyzer

Package Overview
Dependencies
Maintainers
8
Versions
2957
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@next/bundle-analyzer

Use `webpack-bundle-analyzer` in your Next.js project

8.1.1-canary.28
Source
npmnpm
Version published
Weekly downloads
1.2M
-37.1%
Maintainers
8
Weekly downloads
 
Created

What is @next/bundle-analyzer?

The @next/bundle-analyzer package is a tool designed for Next.js applications that allows developers to visualize the size of webpack output files with an interactive zoomable treemap. It helps in identifying which components or libraries are contributing most to the bundle size, making it easier to optimize the application's performance by reducing unnecessary code.

What are @next/bundle-analyzer's main functionalities?

Analyzing the bundle size

This code snippet demonstrates how to integrate @next/bundle-analyzer into a Next.js project. By wrapping the Next.js configuration with the withBundleAnalyzer function and setting the 'enabled' option based on an environment variable, developers can conditionally run the bundle analysis. When ANALYZE is set to 'true', the bundle analyzer will generate a report showing the size of the webpack output files.

const withBundleAnalyzer = require('@next/bundle-analyzer')({
  enabled: process.env.ANALYZE === 'true'
});
module.exports = withBundleAnalyzer({});

Other packages similar to @next/bundle-analyzer

FAQs

Package last updated on 11 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.