Skip to content

Latest commit

 

History

History
52 lines (42 loc) · 711 Bytes

readme.md

File metadata and controls

52 lines (42 loc) · 711 Bytes

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 }
}
*/