https://github.com/guoyunhe/vite-plugin-shit
To prevent shit from your bundle
https://github.com/guoyunhe/vite-plugin-shit
Last synced: 3 months ago
JSON representation
To prevent shit from your bundle
- Host: GitHub
- URL: https://github.com/guoyunhe/vite-plugin-shit
- Owner: guoyunhe
- License: mit
- Created: 2024-01-12T12:37:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-12T15:19:17.000Z (over 1 year ago)
- Last Synced: 2025-02-12T06:52:40.341Z (4 months ago)
- Language: TypeScript
- Size: 58.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# vite-plugin-shit
To prevent shit from your bundle

## Shit score
Let's define `moment`'s shit score as `10`, and `moment` appear 10 times when generating the bundle. And your result shit score is `10 * 10 = 100`.
If your `threshold` is `100`, the plugin will terminate building and print 💩 and where it is from.
## How to use
```bash
npm install --save-dev vite-plugin-shit
``````ts
// vite.config.ts
import { defineConfig } from 'vite';
import shit from 'vite-plugin-shit';export default defineConfig({
plugins: [
shit({
// when reach this much shit, abort building
threshold: 100,
// use recommended shit rules
recommended: true,
// define custom shit rules
rules: {
moment: 50,
lodash: 50,
},
}),
],
});
```