vite-plugin-lib-reporter

Add in your CI a `limit` check of one of these stats:

Downloads
338
Stars
0
Committers
2

vite-plugin-lib-reporter

Add in your CI a limit check of one of these stats:

Installation

pnpm add vite-plugin-lib-reporter -D

Configuration

Add in your vite.config.ts:

import { sveltekit } from "@sveltejs/kit/vite";
import { libReporter } from "vite-plugin-lib-reporter"; // 👈 1/ add import
import type { UserConfig } from "vite";

const config: UserConfig = {
  plugins: [
    sveltekit(),

    /*                  */
    /*   2/ Config 👇   */
    /*                  */
    libReporter([
      {
        name: 'My-Super-Lib-To-Check',
        includes: ['My-Super-Lib-To-Check'],
        // excludes: ["svelte"], // optional
        // always_log_report: false,
        limit: {
          treeshaked: {
            compressed_max: 7,
          },
        },
      },
    ]),

  ],
};

export default config;
  • Either your build will pass ✅
  • Either it will fail because you are hitting a limit you configured. ❌

Visualize your report?

Just run 👇

npm run libReport
Package Rankings
Top 21.67% on Npmjs.org