siza
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i siza

Weekly Downloads

0

Version

0.3.0

License

MIT

Unpacked Size

9.16 kB

Total Files

8

Last publish

Collaborators

  • deepsweet