跳到正文
Skillpedia
部署与云(DevOps)75k · #3029

source-maps

它能做什么

这个技能检查项目的构建是否生成源码映射,以及是否以安全的方式处理它们,以便调试线上问题。它面向希望诊断线上错误、又不暴露代码的开发者。

适用场景

  • ✓你请智能体为线上网站发生的错误设置调试方法的时候。
  • ✓线上错误指向难以阅读的压缩代码的时候。
  • ✓你将应用连接到错误追踪服务,并希望把源码映射上传到该服务的时候。

技能链接

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/source-maps/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/source-maps/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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.

repo: thedaviddias/Front-End-Checklist

热度

GitHub 星标
75k
排名
#3029
许可证
MIT
更新时间
2026/10/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能