Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the .map files used for in angular-cli and can ng build not create these files?

ng build of angular-cli creates 3 files:

inline.bundle.js
vendor.bundle.js
main.bundle.js

and also a map file for each own. What for?

I am also asking if there is a way to change that behavior, not creating these 3 files but copy to dist directory all the js files, not bundle anything. Is that possible?

like image 472
AngularOne Avatar asked Feb 08 '17 16:02

AngularOne


People also ask

What are .map files in Angular?

The . map files are for js and css (and now ts too) files that have been minified. They are called SourceMaps. When you minify a file, like the angular.

What is the purpose of a .map file?

MAP file is for HTML image maps. An image map is formatted in HTML and creates click-able areas over a provided image. More generically, the . MAP extension can be used to denote any file type that indicates relative offsets from a starting point.

What is .map file in TypeScript?

Explanation: TypeScript Map files are source map files that let tools map between the emitted JavaScript code and the TypeScript source files that created it. And these Source Map files will then help to debug the Typescript file instead of debugging the emitted JavaScript file.

What is .map in JavaScript file?

The . map files are for JavaScript and CSS (and now TypeScript too) files that have been minified. They are called source maps. When you minify a file, like the angular. js file, it takes thousands of lines of pretty code and turns it into only a few lines of ugly code.


1 Answers

.map files are used for debugging your application. It is not related with angular-cli and is feature of typescript compiler, you may set\unset in tsconfig file like below,

 "sourceMap": true\false

Hope this helps!!

like image 106
Madhu Ranjan Avatar answered Oct 12 '22 17:10

Madhu Ranjan