0

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

jake
  • 154
  • 2
  • 9
  • maybe it would be easier to have two environments: One that's only accessible to certain users where you build with sourcemaps enabled and the production environment where you build in produciton mode and don't have source maps enabled at all? – cloned Aug 02 '23 at 11:07

0 Answers0