且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

什么是 TypeScript 映射文件?

更新时间:2022-06-06 10:18:57

.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.