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

Configure source map path #11513

Closed
vanmxpx opened this issue Jul 11, 2018 · 3 comments
Closed

Configure source map path #11513

vanmxpx opened this issue Jul 11, 2018 · 3 comments

Comments

@vanmxpx
Copy link

vanmxpx commented Jul 11, 2018

Bug Report or Feature Request (mark with an x)

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

Area

- [x] devkit
- [ ] schematics

Versions

NPM v5.5.1
Angular CLI: 6.0.8
Node: 9.3.0
OS: win32 x64
Angular: 6.0.7
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.6.8
@angular-devkit/build-angular 0.6.8
@angular-devkit/build-optimizer 0.6.8
@angular-devkit/core 0.6.8
@angular-devkit/schematics 0.6.8
@angular/cli 6.0.8
@ngtools/webpack 6.0.8
@schematics/angular 0.6.8
@schematics/update 0.6.8
rxjs 6.2.1
typescript 2.7.2
webpack 4.8.3
Windows (10)

Repro steps

Create default angular application with "ng new [name]". Try to debug in Visual Studio 2017, VS Code, IDEA etc. Type script remote files will be not mapped to the sources, because of wrong webpack:// url.

The log given by the failure

There are no logs

Desired functionality

Since angular-cli removed ng eject command i cannot configure webpack to override source map files location. I need to override devtoolModuleFilenameTemplate option to set normal path with root directory.

Mention any other details that might be useful

@clydin
Copy link
Member

clydin commented Jul 12, 2018

This is not configurable. Most IDEs support debug configurations that allow debugging from within the IDE. Please see this issue with sample configurations for vscode: #2453

@clydin clydin closed this as completed Jul 12, 2018
@adamdoyle
Copy link

adamdoyle commented Dec 4, 2018

This is not configurable. Most IDEs support debug configurations that allow debugging from within the IDE. Please see this issue with sample configurations for vscode: #2453

It seems like you're saying that if you author libraries with webpack, those libraries can't be consumed in an Angular CLI project (if sourcemaps in Chrome are important), unless you're willing to switch from using ng serve to launching with vscode. In my case, I'm using IDEA instead of vscode, which I don't think even has support for what you're suggesting.

So as I read this, it seems the instructions are:

  • stop using ng serve
  • switch IDEs from IDEA to vscode
  • add a rewrite path so that ng build won't screw up the sourcemap path

That's a lot to ask considering it seems like Angular CLI is the one responsible for messing up the sourcemap paths to begin with.

I can include the webpack libraries in a vanilla HTML file via <script></script> tags and the paths look correct and Chrome successfully uses the sourcemaps. But as soon as I funnel it through an Angular CLI project, the paths get rewritten from file:///absolute/path/to/source/ to webpack:///./relative/path/to/source/ and Chrome can no longer handle it. I've read through #2453, but it only has a bunch of vscode-specific workarounds.

edit: as @vanmxpx mentioned in #2453, the inability to eject is also unfortunate since this would be easy to resolve in a webpack config via devtoolModuleFilenameTemplate: . It seems a lot of the heavy lifting is already handled by webpack, all we would really need is for the parameter to be passed through to the user so we can manually remap the paths back to what we started with.

@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
None yet
Projects
None yet
Development

No branches or pull requests

3 participants