source-maps
它能做什么
这个技能检查项目的构建是否生成源码映射,以及是否以安全的方式处理它们,以便调试线上问题。它面向希望诊断线上错误、又不暴露代码的开发者。
适用场景
- ✓你请智能体为线上网站发生的错误设置调试方法的时候。
- ✓线上错误指向难以阅读的压缩代码的时候。
- ✓你将应用连接到错误追踪服务,并希望把源码映射上传到该服务的时候。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/source-maps/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的线上网站错误显示的是压缩代码,我无法阅读。请帮我设置源码映射以便调试吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会更新构建设置以生成源码映射,并检查它们的处理方式。该技能建议将它们上传到错误追踪服务,而不是公开提供。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Provide source maps for production debugging
Source maps are essential for debugging production issues effectively without compromising the performance benefits of minification.
Quick Reference
- Generate source maps to map minified code back to original source
- Upload source maps to error tracking services (e.g., Sentry) instead of serving them publicly
- Ensure source maps are correctly linked in your build process
Check
Verify if the project's build process generates source maps and if they are being correctly handled for production debugging.
Fix
Update the build configuration to generate source maps and integrate with an error tracking service for secure production debugging.
Explain
Explain how source maps enable developers to debug original source code when only minified code is running in the browser.
Code Review
Review the routes, assets, and loading behavior that affect Provide source maps for production debugging. 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/source-maps
常见问题
什么是源码映射?
它是一个将压缩代码链接回原始源代码的文件,使错误能以有用的形式被读取。
源码映射应该公开吗?
这个技能建议将它们上传到错误追踪服务,而不是公开提供。
源码映射会让网站变慢吗?
这个技能说,它们可以在不损失压缩优势的情况下生成,因为它们只用于调试。
详情
作者的原始描述
Use when auditing slow page loads, heavy assets, or rendering delays related to Provide source maps for production debugging. Verify the actual bottleneck in DevTools, Lighthouse, or field data before recommending changes.
热度
- GitHub 星标
- 75k
- 排名
- #3029
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。