Skip to content

Latest commit

 

History

History

siza

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

siza npm

Get bundle size of a React application.

Install

$ yarn add siza

Usage

type TOptions = {
  entryPointPath: string,
  globalConstants?: {
    [key: string]: string,
  },
  globalAliases?: {
    [key: string]: string,
  }
}

type TOutput = {
  vendor: {
    min: number,
    minGzip: number,
  },
  main: {
    min: number,
    minGzip: number,
  }
}

getBundleSize(options: TOptions) => Promise<TOutput>
import { getBundleSize } from 'siza'

const result = await getBundleSize({
  entryPointPath: './App.tsx'
})

console.log(result)
/*
{
  vendor: { min: 129231, minGzip: 40706 },
  main: { min: 293, minGzip: 214 }
}
*/