0.0.10 • Published 6 years ago

codecheck-build-size v0.0.10

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

CodeCheck Build Size

Installation

yarn add --dev codecheck-build-size

or

npm install --dev codecheck-build-size

Usage

Add to your codecheck.js file:

import { buildSize } from "codecheck-build-size";

export async function main() {
  await buildSize({
    files: [
      { path: "./build/static/js/*.js", maxSize: "1MB" },
      { path: "./build/static/css/*.css" },
      { path: "./build/static/images/*.jpg" },
    ],
  });

  // ...
}

API

await buildSize({
  gzip?: boolean, // should we track raw file size or after gzipping? default to true
  files: [
    {
      path: string, // glob supporting path to files
      maxSize?: number | string, // optional maximum allowed size. Can be a number meaning bytes or string like "1MB" or "100KB".
    },
  ];
})
0.0.10

6 years ago

0.0.9

6 years ago