bundle-import-auditor
2
总安装量
2
周安装量
#75689
全站排名
安装命令
npx skills add https://github.com/handxr/bundle-import-auditor --skill bundle-import-auditor
Agent 安装分布
opencode
2
gemini-cli
2
antigravity
2
claude-code
2
windsurf
2
github-copilot
2
Skill 文档
Bundle Import Auditor
Static analysis tool that scans JS/TS imports for patterns that bloat production bundles.
Running the Audit
# Single file
python3 scripts/bundle_import_auditor.py <file>
# Entire project
python3 scripts/bundle_import_auditor.py <directory>
# Include low-severity hints (deep imports, code-splitting opportunities)
python3 scripts/bundle_import_auditor.py <target> --strict
# Machine-readable JSON
python3 scripts/bundle_import_auditor.py <target> --json
No dependencies â uses only Python 3 standard library.
Detection Categories
| Category | Detects | Severity |
|---|---|---|
| Heavy dependencies | 20+ known packages with lighter alternatives (moment, lodash, jquery, axios, uuid…) | Error (100KB+) / Warning |
| Tree-shaking blockers | import * as X wildcards, barrel file re-exports |
Warning |
| Duplicate imports | Same module imported multiple times in one file | Warning |
| Code-splitting | Route/page/modal components that could be lazy-loaded | Info |
| Import hygiene | Deep internal imports, heavy CSS frameworks | Info |
| Lodash patterns | Full lodash import vs per-function or lodash-es | Error / Warning |
Severity Levels
!!Error: Large impact (100KB+) or broken tree-shaking â fix immediately!~Warning: Moderate impact or suboptimal patterns â fix in hot paths~~Info: Improvement opportunities (only shown with--strict)
Fix Priority
- Heavy dependencies â swap moment/lodash/jquery for modern alternatives (biggest wins)
- Lodash full imports â switch to per-function imports or lodash-es
- Wildcard imports â convert
import *to named imports for tree-shaking - Barrel files â import directly from source modules instead of index files
- Code-splitting â lazy-load route/page components
Detailed Rules
For complete detection rules, edge cases, and configuration tips, see references/bundle-rules.md.