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.

Remote sourcemappingurl support

See original GitHub issue

Bug Report or Feature Request (mark with an x)

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

Desired functionality.

I’d like to be able to have a the options intsconfig.compilerOptions.* that pertain to sourceMap config to be configurable.

I’m trying to build production assets that have a sourceMapping like the following

//# sourceMappingURL=http://localhost:4200/inline.bundle.js.map

to facilitate debugging by developers in production environments.

To do this I expected to be able to change the tsconfig.compilerOptions.mapRoot to http://localhost:4200/. However it looks like

https://github.com/angular/angular-cli/blob/master/packages/@ngtools/webpack/src/angular_compiler_plugin.ts#L187-L201

    if (options.sourceMap) {
      this._compilerOptions.sourceMap = true;
      this._compilerOptions.inlineSources = true;
      this._compilerOptions.inlineSourceMap = false;
      this._compilerOptions.mapRoot = undefined;
      // We will set the source to the full path of the file in the loader, so we don't
      // need sourceRoot here.
      this._compilerOptions.sourceRoot = undefined;
    } else {
      this._compilerOptions.sourceMap = false;
      this._compilerOptions.sourceRoot = undefined;
      this._compilerOptions.inlineSources = undefined;
      this._compilerOptions.inlineSourceMap = undefined;
      this._compilerOptions.mapRoot = undefined;
      this._compilerOptions.sourceRoot = undefined;
    }

Overrides the config and doesn’t honor what’s in the tsconfig.json

Thoughts and opinions appreciated.

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
felixtsaicommented, Dec 1, 2017

+1 for this. Trying to set up private sourcemaps for production error reporting.

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

Use a source map — Firefox Source Docs documentation
Use a source map¶. The JavaScript sources executed by the browser are often transformed in some way from the original sources created by...
Read more >
webpack-remote-source-map-loader - npm
A Webpack loader that can locate source maps from their sourceMappingURL and fetches remote sources. This is similar to source-map-loader ...
Read more >
SourceMapDevToolPlugin - webpack
This plugin enables more fine grained control of source map generation. It is also enabled automatically by certain settings of the devtool configuration ......
Read more >
Configuring Sentry with JavaScript Source Maps
An epic troubleshooting tale to enable JavaScript source map fetching in Sentry.
Read more >
JavaScript Debugging with Sourcemaps - TrackJS
A sourcemap is a mapping between the generated/transpiled/minified ... Both Chrome and Firefox currently support the processing of sourcemaps in the ...
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