question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add option for hidden-source-map to use with ng build --prod

See original GitHub issue

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

Versions.

1.4.0-rc2

Repro steps.

Feature

The log given by the failure.

Feature

Desired functionality.

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.

devtool: buildOptions.sourcemaps ? 'hidden-source-map' : false,

https://github.com/mhamel06/angular-cli/blob/2f551150bccdeb6121c79f0b1fd65bfdd68c33ce/packages/%40angular/cli/models/webpack-configs/production.ts#L108-L110

Mention any other details that might be useful.

https://webpack.js.org/configuration/devtool/

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:16
  • Comments:5

github_iconTop GitHub Comments

1reaction
matt-senseyecommented, 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 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.

0reactions
angular-automatic-lock-bot[bot]commented, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular cli build with sourceMap with option hidden
It seems like sourceMap can only set to true/false. Is there any way to pass a object value to commmand-line parameter? like: ng...
Read more >
Source maps in Angular - How to handle them in production ...
This is the recording of the first Angular Zurich Meetup after a long break.In this meetup Kevin talks about the anatomy of source...
Read more >
ng build - Angular
Option Description Value Type Default Value ‑‑aot Build using Ahead of Time compilation. boolean true ‑‑base‑href Base url for the application being built. string ‑‑delete‑output‑path Delete...
Read more >
Devtool - webpack
devtool performance production quality (none) build: fastest rebuild: fastest yes bundle eval build: fast rebuild: fastest no generated eval‑cheap‑source‑map build: ok rebuild: fast no transformed
Read more >
Angular app is non-uglified after I build with "prod" flag ...
ng build --prod. I think Your 'npm run build --prod' is custom command. ... If you are using webpack then try devtool option...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found