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 ?
At its core, a source map is a JSON file that contains all the necessary information to map the transpiled code back to the original sources. Pretty cool! Technically a source map is just a JSON file that contains the following fields: version: indicates the source map spec version.
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
In Angualr CLI 6 options seems to be changed as
ng build --prod --source-map
Or else you can enable source maps in angular.json by setting the sourceMap:true in production configurations
"configurations": { "production": { "optimization": true, "outputHashing": "all", **"sourceMap": false,** --------
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