• Stars
    star
    126
  • Rank 284,543 (Top 6 %)
  • Language
    JavaScript
  • Created almost 9 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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

showBeforeSizes

Note: this feature is experimental and may be changed in a future release.

type: "release", "build", or "none" default: "none"

Indicates how, if any, comparisons will be shown between the output.file file size as it was and as it is now being written.

If set to "release", will compare the file size at present to that of the last npm release.

If set to "build", the size of the file that is now being built will be compared to the immediately previous build. This means that if you run Rollup multiple times with this option, the info on the previous package size will be lost (since Rollup will have overwritten your copy), so with this option, you will need to consult your terminal history to see what the file size was prior to your changes. This option may be useful if you wish to compare size changes incrementally as you are developing rather than comparing to your last release.

format

type : object

default : {}

See the options here

reporter

(Note that this replaces the deprecated optional render function option.)

type : A reporter string (currently "boxen" only), a function, or an array thereof.

Defaults to "boxen".

After rendering occurs, you may wish to pass on the collected file data, e.g., to build a badge for filesizes (as does filesize-badger).

You can use reporter to do so:

filesize({
	reporter: [
		function (options, bundle, {
			minSize, gzipSize, brotliSize, bundleSize,
			fileName,
			// "showBeforeSizes: release"
			lastVersion,
			// "showBeforeSizes: "release" or "showBeforeSizes": "build"
			bundleSizeBefore, brotliSizeBefore, minSizeBefore, gzipSizeBefore
		}) {
			// If a promise is returned, it will be awaited before rendering.
			return promise;
		},
	],
});

theme

type: string

default : 'dark'

options : 'dark'/'light'

choose based on your terminal theme.

License

MIT

More Repositories

1

transform

A polyglot web converter.
TypeScript
7,988
star
2

embed-js

🌻 A lightweight plugin to embed emojis, media, maps, tweets, code and more. ✨
JavaScript
1,267
star
3

moose

🦌 An application to stream, cast and download torrents.
TypeScript
834
star
4

starring

⭐️ Automatically star the npm-packages that you are using on GitHub.
JavaScript
153
star
5

raaga

🎹 An online app to play and learn music on a keyboard.
TypeScript
133
star
6

ng-embed

An AngularJS filter/directive for embedding emojis, media, maps, tweets, code and services
CSS
122
star
7

reference

An online tool to help you sketch human figures by creating different postures
JavaScript
81
star
8

react-typescript-component-starter-kit

🎉 A started kit to write your React Components using Typescript, emotion, storybook, jest, docz and enzyme
TypeScript
77
star
9

react-fuzzy-search

📜 A fuzzy search component written in React
JavaScript
76
star
10

socialShare.js

A jquery plugin to provide more control on social sharing buttons. [DEPRECATED]
JavaScript
72
star
11

ngEmoticons

An AngularJS directive for converting text emojis into image-based emoticons, also supporting automatic multimedia link embedding
CSS
63
star
12

photomosaic.js

A pure JavaScript plugin to create a mosaic of an image.
JavaScript
61
star
13

emoji-assistant

😃 A chrome extension to autosuggest emojis while writing on the web.
JavaScript
45
star
14

react-filters

✨ A collection of customizable filters like radio, slider, autocomplete, range etc. written in React ✨
JavaScript
35
star
15

text-dimensions

Performant Calculation of the width and height of a text string using canvas.
TypeScript
23
star
16

accountant

Invoice Generator, Tax Estimator and more for freelancers without the clutter.
TypeScript
13
star
17

react-component-boilerplate

A boilerplate to create React components using react-transform-hmr, Babel 6, SASS and React-storybook
JavaScript
12
star
18

javascript-plugin-boilerplate

A boilerplate to write plugins in pure JavaScript using ES2015. Includes mocha, chai, prettier, husky, Rollup and Eslint
JavaScript
9
star
19

react-slider

🎚 A slider component made in React
JavaScript
8
star
20

thesaurus

Find similar words even from the other languages.
JavaScript
7
star
21

ritz078.github.io

My personal website
JavaScript
6
star
22

matlab-mean-demo

A demo web-app using Matlab and MEAN stack
MATLAB
3
star
23

slide.js

A lightweight jQuery plugin to slide HTML elements of variable size and with Lazyload support
JavaScript
3
star
24

midi-instruments

A list of all the instruments according to midi spec.
TypeScript
3
star
25

arduinode

A project using arduino and node to transfer data on the browser and then control the arduino.
JavaScript
2
star
26

react-native-component-boilerplate

A boilerplate to create React Native components
JavaScript
2
star
27

nodebot-sample

A simple NodeBot sample
JavaScript
1
star
28

connect-e-dil

An Angular app to send roses (yellow or red) to anyone with a public shoutbox.
CSS
1
star