Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a TypeScript Map file?

Tags:

typescript

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?

like image 740
Sachin Kainth Avatar asked Jul 05 '13 17:07

Sachin Kainth


People also ask

What does TypeScript map do?

map() is an inbuilt TypeScript function that is used to create a new array with the results of calling a provided function on every element in this array.

What is map file used for?

What is a CSS map file? It is a JSON format file that links the CSS file to its source files, normally, files written in preprocessors (i.e., Less, Sass, Stylus, etc.), this is in order do a live debug to the source files from the web browser.

What does a js map file do?

The map file maps the unminified file to the minified file. If you make changes in the unminified file, the changes will be automatically reflected to the minified version of the file.

What are angular map files?

The map files point that code (in the browser) to the actual source files that are written in TS. That makes it easier to figure out at what line in the actual source things are going wrong.


1 Answers

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

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

like image 134
Ryan Cavanaugh Avatar answered Oct 03 '22 22:10

Ryan Cavanaugh