Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shinyaigeek/treeche
Tree-shakable Checker for web frontend bundle size tuning
https://github.com/shinyaigeek/treeche
bundlesize frontend javascript
Last synced: 5 days ago
JSON representation
Tree-shakable Checker for web frontend bundle size tuning
- Host: GitHub
- URL: https://github.com/shinyaigeek/treeche
- Owner: Shinyaigeek
- License: mit
- Created: 2022-05-06T16:09:45.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-03T12:45:26.000Z (almost 2 years ago)
- Last Synced: 2024-05-01T16:25:47.272Z (7 months ago)
- Topics: bundlesize, frontend, javascript
- Language: TypeScript
- Homepage:
- Size: 174 KB
- Stars: 20
- Watchers: 3
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Treeche 🌴
## What is this
**Tree** shakable **Che**cker.
check your module is tree-shakable or not, in each module and reduce bundle size!!
## Feature ✨
- typescript support
- you can check in each file
- you can check with the unique entrypoint
- glob pattern support
- pretty diagnostics report.## How to use 🔧
```bash
npm install treeche -D // TBD
treeche "**/*.ts" --excludes "node_modules" "**/*.test.ts"
```## Example 📕
```typescript
// this is not tree-shakable because have side-effectconst currentYear = new Date().getFullYear();
export function getCurrentYear() {
return `Year ${currentYear}`
}
``````bash
treeche "~~~"
```log
```bash🚨 ~/application/side_effect.ts is not tree-shakable due to the following code:
\`\`\`
const currentYear = new Date().getFullYear();
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
\`\`\`
```if you fix this code such above
```typescript
// this is tree-shakable because this does not have side-effectexport function getCurrentYear(currentYear: string) {
return `Year ${currentYear}`
}
```log
```bash
Congratulation 🎉 All files are tree-shakeable ✨
```## command 💻
|kind|name|description|example|
|:--:|:--:|:--:|:--:|
|argument|inputs|input files to check tree-shakable. you can use Node glob pattern| treeche "src/**/*.ts"|
|option|excludes|excludes files to filter from inputs. you can use Node glob pattern| treeche "src/**/*.ts" --e "node_modules"|
|option|entry point|the unique entry point to check tree-shakable. if you specify input with this, treeche will bundle so you can check tree-shakable also in node_modules| treeche --entry-point ./src/main.ts|