Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request to generate sourcemaps for external services #12375

Closed
NikolaJankovic opened this issue Sep 26, 2018 · 7 comments
Closed

Feature request to generate sourcemaps for external services #12375

NikolaJankovic opened this issue Sep 26, 2018 · 7 comments
Labels
area: devkit/build-angular feature Issue that requests a new feature
Milestone

Comments

@NikolaJankovic
Copy link

Bug Report or Feature Request (mark with an x)

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

Command (mark with an x)

- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Desired functionality

Angular cli doesn't support functionality that would enable uploading sourcemaps to an external service.

Right now if you build with sourcemaps the .map files are generated and their filepath is referenced in the bundle as a comment. The only use case that supports is if you want to host the sourcemaps on the site which has a lot of disadvantages. In most cases you want to generate the sourcemaps and upload them directly to a service that requires them (i.e. sentry) so that they remain private.

Creating 2 independent builds - one with sourcemaps and one without - deploying the latter and uploading the former to a third party service does not work because the filepath reference to the .map file changes the bundle file hash and therefore the 2 builds have different filenames.

Desired functionality would involve passing an argument that would generate .map files in a separate directory under /dist without their filepath referenced in the bundle files as a comment.

@clydin clydin added feature Issue that requests a new feature area: devkit/build-angular labels Sep 26, 2018
@ngbot ngbot bot added this to the Backlog milestone Sep 26, 2018
@NikolaJankovic
Copy link
Author

Is there any word when/if something like this might be implemented?

@NikolaJankovic
Copy link
Author

NikolaJankovic commented Oct 20, 2018

I'll try and create a pull request for this feature this weekend.

webpack already contains this functionality encompassed in the hidden-source-map argument, I'll likely add a --hidden-source-map flag that sets devtool: hidden-source-map when building the webpack config. If anyone has a suggestion or feedback please let me know.

@templth
Copy link

templth commented Nov 23, 2018

@NikolaJankovic any news on this feature? thanks!

@NikolaJankovic
Copy link
Author

@templth I'm still working on having it done but its a lot more involved than I originally thought. I'll hopefully have a pull request in the next few weeks.

@templth
Copy link

templth commented Nov 29, 2018

@NikolaJankovic if I can help you in anyway in this work, feel free to tell me!

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Dec 4, 2018

Hi, this has been implemented and addressed in the latest beta (7.2.0-beta.0) with #13062

In your angular.json you can now use the hidden option, like

sourceMap: {
        hidden: true,
        styles: true,
        scripts: true
},

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: devkit/build-angular feature Issue that requests a new feature
Projects
None yet
Development

No branches or pull requests

4 participants