Show bundle file size of npm packages
$ npm install bundle-size
$ bundle-size --help
Show bundle file size of npm packages
Usage
bundle-size [packages] [options]
Options
-e, --env set NODE_ENV
-h, --help show help
-r, --reporter output style (json)
-v, --version print version
bundle-size react
bundle-size react --env development
bundle-size react -e development -e production
const bundleSize = require('bundle-size');
bundleSize(['react', 'redux'], { env: ['development', 'production'] }).then((results) => {
console.log(results);
});
// react@15.2.1, redux@3.5.2
//
// env bundle minify gzip
// -- 155.65 kB 78.43 kB 24.78 kB
// development 150.89 kB 71.58 kB 23.54 kB
// production 150.81 kB 57.87 kB 18.28 kB
MIT © mkwtys