0.3.0 • Published 3 years ago

siza v0.3.0

Weekly downloads
7
License
MIT
Repository
github
Last release
3 years ago

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