Gathering detailed insights and metrics for @vinxi/rollup-plugin-visualizer
Gathering detailed insights and metrics for @vinxi/rollup-plugin-visualizer
Gathering detailed insights and metrics for @vinxi/rollup-plugin-visualizer
Gathering detailed insights and metrics for @vinxi/rollup-plugin-visualizer
npm install @vinxi/rollup-plugin-visualizer
Typescript
Module System
Min. Node Version
Node Version
NPM Version
70.9
Supply Chain
99.1
Quality
74.8
Maintenance
100
Vulnerability
99.6
License
TypeScript (92.99%)
JavaScript (5.19%)
SCSS (1.82%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
50,913
Last Day
1
Last Week
35
Last Month
207
Last Year
5,586
MIT License
2,043 Stars
555 Commits
59 Forks
6 Watchers
1 Branches
25 Contributors
Updated on Feb 15, 2025
Minified
Minified + Gzipped
Latest Version
5.7.1
Package Id
@vinxi/rollup-plugin-visualizer@5.7.1
Unpacked Size
467.38 kB
Size
116.26 kB
File Count
31
NPM Version
8.1.2
Node Version
17.1.0
Cumulative downloads
Total Downloads
Last Day
-50%
1
Compared to previous day
Last Week
-28.6%
35
Compared to previous week
Last Month
107%
207
Compared to previous month
Last Year
-60.5%
5,586
Compared to previous year
4
1
37
Visualize and analyze your Rollup bundle to see which modules are taking up space.
1npm install --save-dev rollup-plugin-visualizer
or via yarn:
1yarn add --dev rollup-plugin-visualizer
Import
1// es 2import { visualizer } from "rollup-plugin-visualizer"; 3// or 4// cjs 5const { visualizer } = require("rollup-plugin-visualizer");
Usage with rollup (rollup.config.js)
1module.exports = { 2 plugins: [ 3 // put it the last one 4 visualizer(), 5 ], 6};
Usage with vite (vite.config.js)
1module.exports = { 2 plugins: [visualizer()], 3};
Usage with SvelteKit (vite.config.js)
1const config = { 2 plugins: [ 3 visualizer({ 4 emitFile: true, 5 file: 'stats.html' 6 }) 7 ], 8}; 9 10export default config;
You will find 2/3 files in .svelte-kit/output dir named stats.html (see vite logs for file locations) . You can use this snippet as a starting point and change props/path. You can also generate 3 json files and combine them to one with cli util.
Blue color used to to mark project-own files. This could be: written by you files or generated by build tool files.
Green color used to mark your dependencies.
Internally it just checks if file id prefix is node_modules
.
All charts refresh layout on window resize.
This circular hierarchical diagram can help you find huge peaces of code (aka that one huge thing). If you click on some arc it will increase its and all nested arcs size for better inspection.
This rectangular hierarchical diagram can help you find huge peaces. Just look on biggest reclangle. But also it can help you find modules included several times, they will have the same topology and relative size. If you click on reclangle it will increase in size for further inspection.
This digram should help you answer for the question 'why it is included?'. After force layout stabilize all nodes, you can move it back and forth by dragging with your mouse. Gray circles are treeshakened out files.
In real life scenarious, sometimes you will see terribly connected diagrams. There is no 100% working solution for everyone, it is expected you topology will look 'terrible' and not hold on screen. To make it still visually ispectable, first remove all highly connected nodes that you see (typical examples: commonjsHelpers, tslib, react etc, basically if tooltip for the node is not hold on the screen - exclude this node), after layout stabilization you will see, your layout is not that terrible anymore and most of dependencies cluster together. Move layout to find peaces you looked for.
When you click on node it will hightlight nodes that are listed in tooltip (the files that imports current node).
filename
(string, default stats.html
) - name of the file with diagram to generate
title
(string, default Rollup Visualizer
) - title tag value
sourcemap
(boolean, default false
) - Use sourcemaps to calculate sizes (e.g. after UglifyJs or Terser). Always add plugin as last option.
open
(boolean, default false
) - Open generated file in default user agent
emitFile
(boolean, default false
) - Use rollup's emitFile
to generate file
template
(string, default treemap
) - Which diagram type to use: sunburst
, treemap
, network
.
json
(boolean, default false
) - Produce portable json file that can be used with plugin CLI util to generate graph from several json files. Every UI property ignored in this case.
gzipSize
(boolean, default false
) - Collect gzip size from source code and display it at chart.
brotliSize
(boolean, default false
) - Collect brotli size from source code and display it at chart.
projectRoot
(string | RegExp, default process.cwd()
) - This is some common root(s) path to your files. This is used to cut absolute files paths out.
This plugin provides cli util rollup-plugin-visualizer
. Add --help
to check actual options. It can be used like:
1rollup-plugin-visualizer [OPTIONS] stat1.json stat2.json ../stat3.json
This can be usefull in case you have different config files in the same project and you want to display all of them in the same chart.
For development if you need to build plugin, just exec:
1npm run build
Generated html files do not and never will contain your source code (contents of files). They can contain only js/html/css code required to build chart (plugin code) and statistical information about your source code.
This statistical information can contain:
See CHANGELOG.md.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
17 commit(s) and 7 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
3 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
Found 1/30 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
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 2025-02-10
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