Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rollup-analyzer-plugin

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-analyzer-plugin

Analyze file sizes of rollup bundled imports

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

rollup-analyzer-plugin NPM version js-standard-style Dependency Status

Analyze file sizes of rollup bundled imports

rollup-analyzer

Rollup Analyzer gives you a quick look at what's taking up space in your bundle.

Comes in three scrumptious flavors:

rollup-analyzer-plugin

Adding as a plugin to your rollup config or build script will print a well formatted analysis to the console upon bundling.

rollup-analyzer-config

If using Rollup's CLI to bundle with no additonal config, pass -c node:rollup-analyzer-config to print a well formatted analysis to your console.

rollup-analyzer

Full analysis module, giving you access to the complete analysis object or well formatted analysis text for CI and build usage.

Install

$ npm install --save-dev rollup-analyzer-plugin

Usage

usage from rollup config

import analyze from 'rollup-analyzer-plugin'
const opts = {limit: 5, filter: [], root: __dirname}
export default {
  entry: 'module.js',
  dest: 'index.js',
  format: 'cjs',
  plugins: [analyze(opts)]
}

usage from build script

import { rollup } from 'rollup'
const opts = {limit: 5, filter: [], root: __dirname}
import analyze from 'rollup-analyzer-plugin'

rollup({
  entry: 'main.js',
  plugins: [analyze(opts)]
}).then(...)

results

logged to console on rollup completion

-----------------------------
Rollup File Analysis
-----------------------------
bundle size: 1.146 MB
-----------------------------
file: \node_modules\html5-history-api\history.js
size: 38.502 KB
percent: 3.36%
dependents: 1
  - \app\modules\page.js
-----------------------------
file: \node_modules\pikaday\pikaday.js
size: 34.683 KB
percent: 3.03%
dependents: 1
  - \app\helpers\transformer.js
...

Options

  • stdout - optional
    • type: Boolean
    • default: false
    • description: Print to stdout (console.log) instead of stderr (console.error)
  • limit - optional
    • type: Number
    • default: null
    • description: Limit number of files to output analysis of, sorted by DESC size
  • filter - optional
    • type: Array | String
    • default: null
    • description: Filter to only show imports matching the specified name(s)
  • root - optional
    • type: String
    • default: process.cwd()
    • description: Application directory, used to display file paths relatively

License

MIT © Andrew Carpenter

Keywords

FAQs

Package last updated on 07 Jun 2018

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc