1.2.1 • Published 2 years ago
rollup-plugin-filesize-gzbr v1.2.1
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-devor
yarn add rollup-plugin-filesize-gzbr --devExample 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.