Repository navigation
Description
I'm submitting a...
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[X] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:
Current behavior
At the moment sourcemaps sources paths are not correct as they point to the build directory example: ../../../../../../../../../../execroot/angular/bazel-out/darwin-fastbuild/bin/packages/common/http/src/module.ts.
Take a look at: https://unpkg.com/@angular/[email protected]/fesm2015/http.js.map
Ideally during build time these are relocated in order for the consumer of Angular to be able to debug easier as at the moment, If someone tries to use these sourcemaps it is a bit difficult for consumers to find what they are looking for especially considering if you type @angular/core nothing comes up.
With ng-packagr we are doing this and you can have a look here;
https://github.com/dherges/ng-packagr/blob/4e6c4f4bb21869c69f084560af3fa75531e4d07f/src/lib/ng-v5/entry-point/relocate-source-maps.transform.ts
The sourcemaps can eventually be emitted with the correct path, and flatten module id, so the consumers can find it easier.
example;
ng://@angular/common/http/src/module.ts
Expected behavior
Sourcemaps are relocated for a better debugging experience.
Environment
Angular version: 6.0.0-rc5

Activity
[-]Angular 6 - Relocate sourcemaps[/-][+]Bazel - Relocate sourcemaps[/+]jelbourn commentedon Oct 16, 2020
@alan-agius4 is this related to #19841?
alan-agius4 commentedon Oct 17, 2020
Should be, closing in favour of the mentioned issue.
petebacondarwin commentedon Oct 19, 2020
Reopening as the other issue is related to pre-Bazel build scripts which are no longer relevant. If there is an issue, it needs to be fixed in our Bazel build tooling.
petebacondarwin commentedon Oct 19, 2020
The path to the source-maps is bad. They are also a bit useless, since we provide the source content inline. I agree with @alan-agius4 that we should transform these paths into something similar to what ng-packagr does - which is to remove the leading
../segments and prefix with a "protocol" such asng:. This is similar to what webpack does with its "virtual" file paths where it prefixes files withwebpack:.petebacondarwin commentedon Oct 19, 2020
Fixing this would probably also solve #39293.
petebacondarwin commentedon Oct 19, 2020
Actually, let's track this at #14021, since that has been around longer and contains more analysis.
The solution proposed here feels more like a hack rather than a fix for the underlying problem (which is that our build system points source-map sources to paths that are outside of the distributed code. But maybe a hack is the best we can do to fix this...
angular-automatic-lock-bot commentedon Nov 19, 2020
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.