如何在生产服务器中调试 Angular? [英] How to debug Angular in prod server?
本文介绍了如何在生产服务器中调试 Angular?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在开发环境中,我可以使用 Chrome 源标签进行调试,但在 prod 服务器中,我在运行 ng build --prod
后使用 dist 文件夹内容.该文件夹包含编译后的代码,因此如果生产中出现问题我不知道如何调试以找到问题.
In the development environment I can debug with the Chrome source tab , but in the prod server I use the dist folder content after running ng build --prod
. This folder contains compiled code so if there is a problem in the production I don't know how to debug to find the problem.
是否可以通过生产编译代码进行调试?
Is it possible to debug through the production compiled code ?
推荐答案
更新:你可以试试ng build --prod --sourcemap
对于以前版本的 angular-2 这将起作用,ng build --prod --sourcemap
For the previous versions of angular-2 this would work , ng build --prod --sourcemap
对于 Angular 12
ng build --source-map
对于 Angular 8
如评论中所述
ng build --prod --sourceMap
这篇关于如何在生产服务器中调试 Angular?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文