Skip to content

Remote sourcemappingurl support #8426

@adamclerk

Description

@adamclerk

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P5The team acknowledges the request but does not plan to address it, it remains open for discussionfeatureLabel used to distinguish feature request from other issueshelp wantedLabel noting an issue which the team is looking for contribution from the community to fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions