How to debug Angular in prod server?

Issue

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 ?

Solution

Update:
You can tryng build --prod --sourcemap

For the previous versions of angular-2 this would work , ng build --prod --sourcemap

For Angular 12

ng build --source-map

For Angular 8

As mentioned in the comments

ng build --prod --sourceMap

Answered By – DeborahK

Answer Checked By – Terry (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.