duplicate-js
它能做什么
这项技能检查网站中是否存在重复的 JavaScript 库,例如同一工具的两个版本。适合希望页面更快、更稳定的开发者。
适用场景
- ✓当页面下载了同一个库两次时。
- ✓当打包审计显示大型库在多个页面中重复出现时。
- ✓当第三方脚本带入了自己的常用代码副本时。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/duplicate-js/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“你能检查我的网站是否多次加载了同一个 JavaScript 库吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会在已加载的代码中查找同一个库的多个版本或副本。然后建议将它们合并为单一版本。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Remove duplicate JavaScript libraries
Duplicate libraries increase bundle size and memory usage, and can lead to unexpected behavior or conflicts between different versions of the same code.
Quick Reference
- Detect and remove multiple versions of the same library
- Use a single version across the entire application
- Audit third-party scripts for bundled dependencies
Check
Identify duplicate JavaScript libraries or multiple versions of the same library being loaded using Lighthouse or bundle analysis tools.
Fix
Consolidate dependencies to use a single version and ensure third-party scripts don't bring in redundant libraries.
Explain
Explain the risks of loading duplicate JavaScript libraries and how it impacts performance and stability.
Code Review
Review the routes, assets, and loading behavior that affect Remove duplicate JavaScript libraries. Flag exact files, requests, or rendering steps that add unnecessary network, CPU, or layout cost, and describe the measurement method used to confirm the issue.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/performance/duplicate-js
常见问题
重复的库为什么重要?
它们会使下载体积增大、占用更多内存,而且不同版本可能相互冲突。
如何找到它们?
这项技能建议使用 Lighthouse 或打包分析工具。
它涵盖第三方脚本吗?
涵盖。这项技能说明,要检查第三方脚本是否带入了额外的副本。
详情
作者的原始描述
Use when auditing slow page loads, heavy assets, or rendering delays related to Remove duplicate JavaScript libraries. Verify the actual bottleneck in DevTools, Lighthouse, or field data before recommending changes.
热度
- GitHub 星标
- 75k
- 排名
- #2826
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。