https://github.com/jonambas/esbuild-plugin-limit-size
A tiny (2kb) bundle size limiter plugin for esbuild.
https://github.com/jonambas/esbuild-plugin-limit-size
esbuild esbuild-plugin esbuild-plugins typescript
Last synced: 4 months ago
JSON representation
A tiny (2kb) bundle size limiter plugin for esbuild.
- Host: GitHub
- URL: https://github.com/jonambas/esbuild-plugin-limit-size
- Owner: jonambas
- License: mit
- Created: 2022-07-11T12:25:18.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-27T17:39:25.000Z (almost 2 years ago)
- Last Synced: 2025-03-07T08:48:45.874Z (4 months ago)
- Topics: esbuild, esbuild-plugin, esbuild-plugins, typescript
- Language: JavaScript
- Homepage:
- Size: 91.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
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.