Does Angular provide a method of outputting source maps to a custom location?

232 Views Asked by At

I have my angular (v16) production code minified. I don't currently output source maps because I don't want end users to be able to get to them. I want to start adding source maps to the production build so that production code can be more easily debugged, however I want only some users to be able to access the maps while regular users cannot.

My plan is to make a folder on a server to which only my defined users have access. Any other user wouldn't be able to access the folder. The source maps will be put into that folder which will be pointed to by a url.

My current issue is that I cannot find an option to set up Angular to put the map files into a folder that is separate from the source files.

I know webpack is used by angular and it has options to set the folder https://webpack.js.org/plugins/source-map-dev-tool-plugin/. That does what I want, but I don't think it's exposed by Angular. At least I have yet to find it.

The documentation for source maps is limited to a few boolean options that do not include setting a url or path to place source maps. https://angular.io/guide/workspace-config#source-map-configuration

0

There are 0 best solutions below