SourceMap
HTTP 响应头链接生成的代码到一个 source map,使浏览器能够重建原始的资源然后显示在调试器里。
Header 类型 | Response header |
---|---|
Forbidden header name | no |
语法
SourceMap: <url> X-SourceMap: <url> (deprecated)
指令
<url>
- 指向一个source map文件的一个相对(于请求的URL)或者一个绝对的URL。
例子
SourceMap: /path/to/file.js.map
规范
Specification | Title |
---|---|
Draft document | Source Map Revision 3 Proposal |
浏览器兼容性
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Feature | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic Support | (Yes) X- (Yes) | ? | 27.0 X- 55.0 | ? | ? | (Yes) X- (Yes) |
Feature | Android | Chrome for Android | Edge mobile | Firefox for Android | IE mobile | Opera Android | iOS Safari |
---|---|---|---|---|---|---|---|
Basic Support | ? | ? | ? | 27.0 X- 55.0 | ? | ? | ? |