šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

next-in-it-stats

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-in-it-stats

next plugin to generate in-it stats

1.0.42
latest
npm
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
Ā 
Created
Source

Next In-It Stats

Keep track of your next.js app's bundle.

next-in-it-stats is a TypeScript package that helps you analyze and keep track of your nextjs bundle sizes over time. It provides valuable insights into the growth and changes in your bundles, allowing you to set limits and detect bloated dependencies.

Installation

npm install next-in-it-stats

Integration

// next.config.js
const withInItStats = require('next-in-it-stats/cjs')({
  legacy: true,
}); // or import withInItStats from 'next-in-it-stats' if you use esm;

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
};

module.exports = withInItStats(nextConfig);

Usage

Now when you run npm build you'll see a link to analyze your bundles. analyze link

You can click it to see the bundle analyzer report. bundle analyzer report

Or you can see your apps page (after logging in) and click on the app you want to analyze. apps page

Limit bundles (work in progress)

// .in-itrc.js or "in-it" in package.json or any other supported config file
module.exports = {
    "track": "**/*", // globby to which files in the build dir you want to track (default)
    "limits": [
        {
            "server/chunks/**/*": {
                "maxSize": "10mb",
            }
        },
        {
            "static/chunks/app/layout*": {
                "maxSize": "10kb",
                "maxDifference": "10%", // not yet supported
            }
        },
        {
            "static/chunks/app/page*": {
                "maxSize": "5kb",
                "prohibitedModules": [ // not yet supported
                    "lodash",
                ]
            }
        },
    ]
};

Keywords

in-it

FAQs

Package last updated on 27 Jun 2023

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