Gathering detailed insights and metrics for rollup-plugin-analyzer
Gathering detailed insights and metrics for rollup-plugin-analyzer
Gathering detailed insights and metrics for rollup-plugin-analyzer
Gathering detailed insights and metrics for rollup-plugin-analyzer
npm install rollup-plugin-analyzer
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.7
Supply Chain
100
Quality
76
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
8,829,638
Last Day
1,089
Last Week
55,314
Last Month
236,225
Last Year
3,131,399
242 Stars
120 Commits
4 Forks
5 Watching
6 Branches
5 Contributors
Minified
Minified + Gzipped
Latest Version
4.0.0
Package Id
rollup-plugin-analyzer@4.0.0
Size
10.86 kB
NPM Version
6.14.4
Node Version
13.14.0
Publised On
20 Dec 2020
Cumulative downloads
Total Downloads
Last day
-3.1%
1,089
Compared to previous day
Last week
-0.3%
55,314
Compared to previous week
Last month
-6.4%
236,225
Compared to previous month
Last year
15%
3,131,399
Compared to previous year
Mad metrics for your rollup bundles, know all the things
1$ npm install --save-dev rollup-plugin-analyzer
1import analyze from 'rollup-plugin-analyzer'
1const analyze = require('rollup-plugin-analyzer')
1export default { 2 entry: 'module.js', 3 dest: 'index.js', 4 format: 'cjs', 5 plugins: [analyze()] 6}
1rollup({ 2 entry: 'main.js', 3 plugins: [analyze()] 4}).then(...)
1const limitBytes = 1e6 2 3const onAnalysis = ({ bundleSize }) => { 4 if (bundleSize < limitBytes) return 5 console.log(`Bundle size exceeds ${limitBytes} bytes: ${bundleSize} bytes`) 6 return process.exit(1) 7} 8 9rollup({ 10 entry: 'main.js', 11 plugins: [analyze({ onAnalysis, skipFormatted: true })] 12}).then(...)
logged to console on rollup completion
1----------------------------- 2Rollup File Analysis 3----------------------------- 4bundle size: 2.809 KB 5original size: 11.436 KB 6code reduction: 75.44 % 7module count: 5 8 9█████████████████████████████████████████████░░░░░ 10file: /virtual-insanity.js 11bundle space: 90.64 % 12rendered size: 2.546 KB 13original size: 2.57 KB 14code reduction: 0.93 % 15dependents: 1 16 - /jamiroquai.js 17 18██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 19file: /bundle-a.js 20bundle space: 4.27 % 21rendered size: 120 Bytes 22original size: 309 Bytes 23code reduction: 61.17 % 24dependents: 0 25 26█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 27file: /jamiroquai.js 28bundle space: 2.95 % 29rendered size: 83 Bytes 30original size: 169 Bytes 31code reduction: 50.89 % 32dependents: 1 33 - /the-alphabet-but-incomplete.js 34...
summaryOnly
enabled)1----------------------------- 2Rollup File Analysis 3----------------------------- 4bundle size: 2.809 KB 5original size: 11.436 KB 6code reduction: 75.44 % 7module count: 5 8 9/virtual-insanity.js 10█████████████████████████████████████████████░░░░░ 90.64 % (2.546 KB) 11/bundle-a.js 12██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 4.27 % (120 Bytes) 13/jamiroquai.js 14█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2.95 % (83 Bytes) 15/the-alphabet-but-incomplete.js 16░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.17 % (33 Bytes) 17/the-declaration-of-independence.js 18░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.96 % (27 Bytes)
false
null
null
filterSummary
to true
module
object specified below, should return booleanfalse
true
the filter
and limit
options will also remove any filtered out module data from the summaryprocess.cwd()
false
false
false
false
null
null
(id) => id.replace(/^\0(?:commonjs-proxy:)?/, '')
null
module
analysis objects
This module is geared towards the details of the individual modules that make up the bundle and their relative impact to bundle size. That's a detailed way of saying, it doesn't really care about size on disk. There are other options which focus on size on disk as well as delivery size which can be used alongside this module (or in place of if your concern is not per module impact). In particular rollup-plugin-size-snapshot seems like a great option for that.
Getting a bit further into the details, rather than just intent, of why the reported size differs from that on disk. We get the module data from Rollup which reports it after chunk (module) resolution and tree-shaking, but before post-processing (such as minification and compression). We then add the sizes of each of those modules together, this is the bundle size
that we report.
That means it won't account for post-processing from other plugins and also won't account for post-processing by Rollup itself, which includes boilerplate / shims depending on what the output format is (CJS, ESM, iife, etc...).
Rollup allows you to output to multiple files. If you are outputting to multiple files you will get a distinct analysis for each output file. Each analysis will contain data on the files imported by the respective target.
MIT © Andrew Carpenter
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
5 existing vulnerabilities detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 2/24 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More