rollup-plugin-filesize-gzbr

1.2.1 • Public • Published

Filesize for Gzip & Brotli Rollup Plugin

This plugin provides an easy way to calculate and display file sizes for the generated bundles during the build process. It calculates the uncompressed, gzip-compressed, and brotli-compressed sizes of the generated bundles and logs them to the console.

Installation

You can install the plugin via npm or Yarn:

npm install rollup-plugin-filesize-gzbr --save-dev

or

yarn add rollup-plugin-filesize-gzbr --dev

Example Usage

import filesize from 'rollup-plugin-filesize-gzbr';

export default {
	input: 'src/index.js',
	output: {
		file: 'dist/bundle.js',
	},
	plugins: [
		filesize()
	],
};

Options

The filesize-gzbr plugin accepts an optional options object with the following properties:

  • types (string | string[]): Specifies the file types for which the sizes should be calculated. Default: [] (calculates sizes for all files). Examples:
    • 'asset': Calculates sizes only for asset files.
    • 'chunk': Calculates sizes only for chunk files.
    • ['asset', 'chunk']: Calculates sizes for asset and chunk files.

/rollup-plugin-filesize-gzbr/

    Package Sidebar

    Install

    npm i rollup-plugin-filesize-gzbr

    Weekly Downloads

    1

    Version

    1.2.1

    License

    MIT

    Unpacked Size

    5.36 kB

    Total Files

    4

    Last publish

    Collaborators

    • pfaciana