You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add option for hidden-source-map to use with ng build --prod #7527
Add an option to generate hidden source maps for production builds. Hidden source maps are helpful because they are full source maps, but not referenced in the minified files. This allows a developer to use the source maps for debugging purposes without letting the browser know they exist. Error tracking sites such as Atatus allow users to upload source maps manually so the stack traces are more useful and the maps never need to be made public.
In my case, I have modified my fork of the cli to generate hidden source maps when using the production build and source-maps=true. This has worked for me, but I didn't expect it would be the best fit for the whole project.
@cburger - if it's helpful, as a workaround what we do is have a script in package.json which runs ng build then immediately moves the sourcemaps out of dist and into a separate sourcemaps folder. This allows us to upload them to Sentry without including them in the app deployment. It'd be better if they were proper hidden sourcemaps, but it gets us most of the way there.
Thank you @matt-senseye . Yes, this is pretty much what I am doing at the moment. I exclude the mappings when I do the rsync to the server. Angular just keeps throwing a warning in the console because it can't find the mappings. Would be better to do the build correctly. Another solution would have been to escape Angular CLI to edit the Webpack config, but that is also no longer supported.
Activity
cburza commentedon Jun 21, 2018
Any update on this? I have no way of doing builds with hidden source maps so I can upload them to sentry.io.
matt-senseye commentedon Jun 21, 2018
@cburger - if it's helpful, as a workaround what we do is have a script in package.json which runs ng build then immediately moves the sourcemaps out of
distand into a separatesourcemapsfolder. This allows us to upload them to Sentry without including them in the app deployment. It'd be better if they were proper hidden sourcemaps, but it gets us most of the way there.cburza commentedon Jun 21, 2018
Thank you @matt-senseye . Yes, this is pretty much what I am doing at the moment. I exclude the mappings when I do the rsync to the server. Angular just keeps throwing a warning in the console because it can't find the mappings. Would be better to do the build correctly. Another solution would have been to escape Angular CLI to edit the Webpack config, but that is also no longer supported.
feat(@angular-devkit/build-angular): fine grain settings for sourceMa…
anil-tf-zz commentedon Jul 31, 2019
Is there an example of this somewhere? How to use the fine grain settings (e.g. hidden) via commandline?
ng build --prod --hidden-source-mapangular-automatic-lock-bot commentedon Sep 9, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
feat(@angular-devkit/build-angular): fine grain settings for sourceMa…