esbuild-plugin-limit-size
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

esbuild-plugin-limit-size

A tiny (2kb) bundle size limiter plugin for esbuild.

const { build } = require('esbuild');
const { limitSizePlugin } = require('esbuild-plugin-limit-size');

build({
  ...yourOptions,
  plugins: [limitSizePlugin(limit, shouldThrow)]
}).catch(() => process.exit(1));

Plugin Args

limit

Type: number Default: 500

Sets the bundle size limit in KBs. This plugin at the moment only checks outputted .js files.

shouldThrow

Type: boolean Default: false

When this is set to true, and the provided limit has been exceeded, the plugin will throw an error.

Readme

Keywords

none

Package Sidebar

Install

npm i esbuild-plugin-limit-size

Weekly Downloads

1

Version

0.0.4

License

MIT

Unpacked Size

4.48 kB

Total Files

4

Last publish

Collaborators

  • jonambas