angular-cli 中使用的 .map 文件是什么,ng build 可以不创建这些文件吗? [英] What are the .map files used for in angular-cli and can ng build not create these files?
本文介绍了angular-cli 中使用的 .map 文件是什么,ng build 可以不创建这些文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
angular-cli 的 ng 构建创建了 3 个文件:
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?
我还问是否有办法改变这种行为,不是创建这 3 个文件,而是将所有 js 文件复制到 dist 目录,而不是捆绑任何东西.这可能吗?
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?
推荐答案
.map
文件用于调试您的应用程序.它与 angular-cli 无关,是 typescript 编译器的特性,您可以在 tsconfig 文件中设置\unset,如下所示,
.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
希望这有帮助!!
这篇关于angular-cli 中使用的 .map 文件是什么,ng build 可以不创建这些文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文