Add option for hidden-source-map to use with ng build --prod
See original GitHub issueBug 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,
Mention any other details that might be useful.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:16
- Comments:5
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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 separatesourcemaps
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.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.