# esbuild-plugin-limit-size

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

Latest version **0.0.4** (published 2022-07-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install esbuild-plugin-limit-size
pnpm add esbuild-plugin-limit-size
yarn add esbuild-plugin-limit-size
bun add esbuild-plugin-limit-size
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2022-07-30 |
| First published | 2022-07-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jon Ambas |
| Maintainers | jonambas |

## Links

- npm: https://www.npmjs.com/package/esbuild-plugin-limit-size
- Repository: https://github.com/jonambas/esbuild-plugin-limit-size
- Homepage: https://github.com/jonambas/esbuild-plugin-limit-size#readme
- Issues: https://github.com/jonambas/esbuild-plugin-limit-size/issues
- npm.io page: https://npm.io/package/esbuild-plugin-limit-size

## Dependencies (1)

- [picocolors](https://npm.io/package/picocolors.md) ^1.0.0

## Recent versions

- 0.0.4 (latest) — 2022-07-30
- 0.0.3 — 2022-07-11
- 0.0.2 — 2022-07-11
- 0.0.1 — 2022-07-11

## README

# esbuild-plugin-limit-size

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

```js
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.

---
_Source: https://npm.io/package/esbuild-plugin-limit-size · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
