警告:-file- is being assigned a //# sourceMappingURL, but already has one
当为给定 JavaScript 源多次指定源映射时,会出现 JavaScript 警告 "-file- is being assigned a //# sourceMappingURL, but already has one."。
¥The JavaScript warning "-file- is being assigned a //# sourceMappingURL, but already has one." occurs when a source map has been specified more than once for a given JavaScript source.
信息
错误类型
什么地方出了错?
¥What went wrong?
已为给定 JavaScript 源多次指定源映射。
¥A source map has been specified more than once for a given JavaScript source.
JavaScript 源通常会被组合和缩小,以便更有效地从服务器交付它们。使用 源映射,调试器可以将正在执行的代码映射到原始源文件。有两种方法可以分配源映射,即使用注释或为 JavaScript 文件设置标头。
¥JavaScript sources are often combined and minified to make delivering them from the server more efficient. With source maps, the debugger can map the code being executed to the original source files. There are two ways to assign a source map, either by using a comment or by setting a header to the JavaScript file.
示例
设置源映射
也可以看看
¥See also
- Firefox 源文档中的 使用源地图
- developer.chrome.com 上的 JavaScript 源映射简介 (2012)