yohangz / rollup-plugin-filesize

A rollup plugin to show file size of the bundle in the cli

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rollup-plugin-filesize

A rollup plugin to show filesize in the cli

Installation

npm install rollup-plugin-filesize

Usage

import { rollup } from 'rollup';
import filesize from 'rollup-plugin-filesize';

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

options

showMinifiedSize

type: boolean default: true

Whether to show minified size or not

showGzippedSize

type: boolean default: true

Whether to show Gzipped size or not

showBrotliSize

type: boolean default: false

Whether to show Brotli size or not

format

type : object

default : {}

See the options here

render

type : function

return the command that you want to log. Eg:

filesize({
	render : function (options, bundle, { minSize, gzipSize, brotliSize, bundleSize }){
		return minSize;
	}
})

theme

type: string

default : 'dark'

options : 'dark'/'light'

choose based on your terminal theme.

License

MIT

About

A rollup plugin to show file size of the bundle in the cli


Languages

Language:JavaScript 100.0%