Angular-Cli中使用的.map文件有哪些,并且ng build不能创建这些文件吗? [英] What are the .map files used for in angular-cli and can ng build not create these files?

查看:483
本文介绍了Angular-Cli中使用的.map文件有哪些,并且ng build不能创建这些文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ng-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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆