@condenast/bundlesize

0.18.1 • Public • Published



Keep your bundle size in check

 

Build Status NPM Version NPM Downloads  

minimal setup

npm install bundlesize --save-dev

 

usage

Add it to your scripts in package.json

"scripts": {
  "test": "bundlesize"
}

 

Or you can use npx with NPM 5.2+.

npx bundlesize

configuration

 

1) Add the path and maxSize in your package.json.

By default the gzipped size is tested. You can use the compression option to change this. (gzip, brotli, or none).

{
  "name": "your cool library",
  "version": "1.1.2",
  "bundlesize": [
    {
      "path": "./dist.js",
      "maxSize": "3 kB"
    }
  ]
}

bundlesize also supports glob patterns

Example:

"bundlesize": [
  {
    "path": "./dist/vendor-*.js",
    "maxSize": "3 kB"
  },
  {
    "path": "./dist/chunk-*.js",
    "maxSize": "3 kB"
  }
]

This makes it great for using with applications that are bundled with another tool. It will match multiple files if necessary and create a new row for each file.

 

2) build status

build status

Currently works for Travis CI, CircleCI, Wercker, and Drone.

(Ask me for help if you're stuck)

 

CLI

example usage:

bundlesize -f "dist/*.js" -s 20kB

For more granular configuration, we recommend configuring it in the package.json (documented above).

 

like it?

this repo

 

how to contribute?

 

Featured on Totally tooling tips and Chrome Dev Summit!!

 

who uses bundlesize?

 

TODO

  • Work with other CI tools
  • Automate setup (setting env_var)

 

similar projects

Contributors

This project exists thanks to all the people who contribute. [Contribute].

license

MIT © siddharthkp

Package Sidebar

Install

npm i @condenast/bundlesize

Weekly Downloads

36

Version

0.18.1

License

MIT

Unpacked Size

21.1 kB

Total Files

16

Last publish

Collaborators

  • tdscondenast
  • omsun22
  • midhunmurali001
  • saicharan7766
  • surabhidesai
  • suhitrathi-condenast
  • dkorenblyum
  • bbui
  • rajashreearvikar19
  • tejasvi-bg
  • vnallasa
  • nishkalaadiga
  • vikas-sc
  • skumar7
  • cyrilpanicker-condenast
  • boygao1992
  • saikat_conde
  • imleodc
  • jasonmarlin
  • arunconde
  • roberlander
  • nprabhu-cn
  • juliendevlin
  • unviradiya
  • vinitha_thiagarajan
  • areadman
  • samruddhidube24
  • gapurdev
  • akshayjain10
  • utkarsh24
  • suma_k
  • piyush_das
  • cnmanju
  • jkraus
  • sharvanipatil
  • cn-rahul-tiwari
  • dhanashri027
  • bharathikarunanithi
  • cn_priyanka14
  • kishor-kumar07
  • prashant_singhparihar
  • m-mallikarjuna
  • smantriconde
  • machelslackatcondenast
  • karthik_cn
  • muthuprakashvelumani
  • issanjana
  • a-rena
  • colin-alexa
  • ramkun
  • namansingh_bhandari
  • max-prin
  • cnarkhede
  • hebsibal_selvaraj
  • akeshavamurthy
  • priyanka_jha
  • saniyashk
  • klnarayanan
  • spoorthi.chandrashekar
  • erikveland
  • asinghconde
  • eunianina
  • raxs
  • vivekans
  • conde_jode
  • jordi.escude
  • nnasirov
  • unnatik
  • vinayashreeram
  • psundar
  • arhovale
  • rashmicn
  • siddhu-23
  • atp-engineering
  • katiasfihi
  • danj-cn
  • maila-labib
  • anilc93
  • lavishgambhir
  • ksriniva2
  • andregcab
  • tchathur
  • kangkanbora
  • vinay-pr
  • josephrussell-cn
  • anaedzm
  • cn-connorbrannigan
  • prajwal_keshav
  • babincondenast
  • edistel
  • balar20
  • cn_jenkins
  • frandevinney
  • renovate
  • condenastadmin
  • copilot-robot
  • fennen529
  • fmadrie
  • gkilian
  • gmedina
  • bigzed
  • prakashn37
  • imran-conde
  • andi.anderson522
  • tamal_banerjee
  • davidkofahl
  • tollmanz
  • amalamchtal
  • tdshap
  • sayeedcn
  • pitchfork-dev
  • danhaller
  • rajasinghcondenast
  • derrickatcn
  • tce
  • cnid_engineering
  • lilyhealey
  • varun9110
  • prajaktak
  • manthanbhosle
  • psharma2
  • bhumikakhatri
  • igostu
  • tobe998
  • cwoldt
  • ndi
  • mtzhang
  • manthanraut
  • drosenbaum
  • aswani_gupta
  • garryyao
  • yakshita
  • kalyanikasar
  • shreyapa
  • natelawscn
  • leahzxxz
  • katemont
  • eddleston
  • rtt
  • eshno
  • anwaukoni
  • eduardoveras
  • mrgentax
  • cl4m
  • spollini
  • fedeava
  • guidop91
  • nithya10
  • abigaild45
  • mb_dev
  • emilyatk
  • luis_gomez
  • karmenn
  • khiaraortiz
  • dmitriy_komarov-cn
  • jmcamacho
  • ishita_tiwari
  • sanjana_s
  • hariprasath_cn
  • iamsuneeth
  • srikanthns
  • mitchellstewart
  • pushp-1992
  • sudiptacondenast
  • utkarsh_sanjivan-conde
  • mallica
  • shobith
  • rashmi-rao
  • agururajan
  • upenpanging
  • speluri
  • rjain198
  • ashwini_uppar
  • pmasade
  • jbergdol
  • suresharam
  • dhanraj_cn
  • pratik-gupta
  • ilankumaran
  • samtiffin
  • adityaanand534
  • chandan-condenast
  • alokreddycn
  • pranjal_sharma306500
  • vijayalakshmi-sunagar
  • namankumarsinha
  • sumitmaurya21
  • pashoka
  • nidhiarya-condenast
  • smita2022
  • snehadg
  • ankushvijay93
  • likhita
  • priyankanandi
  • soumyagundu
  • cnrahulrkr
  • ramya-cn
  • dikshita_khandke
  • ambay_chaurasia
  • manikandancn
  • rghvndr99
  • mulla2