doesdev / rollup-analyzer-config

Analyze file sizes of rollup bundled imports

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DEPRECATED

In order to best conform with Rollup recommendations for plugin naming and also provide a more integrated solution this module is no longer active. The new version has many enhancements over this so please switch to it.

* The prior plugin module is also no longer active, in favor of using Rollup's standardized naming format for plugins.

For the plugin please use rollup-plugin-analyzer rather than anything listed down the page.

rollup-analyzer-config 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:

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

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.

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-config

Usage

rollup -c node:rollup-analyzer-config -f cjs -o index.js module.js

Results

Something like this will be logged to stderr on bundle 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
...

License

MIT © Andrew Carpenter

About

Analyze file sizes of rollup bundled imports

License:MIT License


Languages

Language:JavaScript 100.0%