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?
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.
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.
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.
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.
.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!!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With