什么是 TypeScript 映射文件? [英] What is a TypeScript Map file?

查看:46
本文介绍了什么是 TypeScript 映射文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到了 TypeScript 的 .map 文件.我想知道的是这些文件的用途.它们是否包含对 .ts 文件中引用的其他文件的引用?

I have seen .map files for TypeScript. What I want to know is what these files are for. Do they contain references to other files referenced in the .ts file?

推荐答案

.map 文件是源映射文件,可让工具在发出的 JavaScript 代码和创建它的 TypeScript 源文件之间进行映射.许多调试器(例如 Visual Studio 或 Chrome 的开发工具)可以使用这些文件,因此您可以调试 TypeScript 文件而不是 JavaScript 文件.

.map files are source map files that let tools map between the emitted JavaScript code and the TypeScript source files that created it. Many debuggers (e.g. Visual Studio or Chrome's dev tools) can consume these files so you can debug the TypeScript file instead of the JavaScript file.

这与一些压缩器和其他编译为 JS 的语言(如 CoffeeScript)生成的源映射格式相同.

This is the same source map format being produced by some minifiers and other compiled-to-JS languages like CoffeeScript.

这篇关于什么是 TypeScript 映射文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆