Skip to content

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

Closed
@mhamel06

Description

@mhamel06

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/

Metadata

Metadata

Assignees

No one assigned

    Labels

    P5The team acknowledges the request but does not plan to address it, it remains open for discussionfeatureIssue that requests a new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions