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
Natural/relative source map source file paths #1622
Comments
@alastair-todd are you using the vendorSourceMap option in the Angular CLI? Since ng-packagr generates a library it’s sourcemap will not be picked up automatically by webpack unless this option is enabled. Updating the source content to point to the actual src root works in this case because the src folder exists, in most cases this will not exists such as when publishing a library to npm. |
@alan-agius4 I had been doing in the project as a means to see the library typescript in dev tools - but recently I noticed these appear now anyway - just gathered this was to do with recent ng9 up / Ivy. That said, with or without vendorSourceMap appears not to effect the contents of the map files in dist/ in terms of file paths... Everything works - the coverage is picked up so the library is being instrumented by nyc, its just when you click through to the to the file in the generated report its not found
The following simple workaround to remap the output is doing the trick
|
This issue has been automatically locked due to inactivity. |
Type of Issue
Description
When building a project of type library and generating source maps, the paths in the map file to the original files are prefixed
ng://
and don't actually point to anywhere that exists"sources":["ng://shared-modules/lib/utils/string-utils.ts",
(also missing/src
folder)If I manually update the map to natural / relative paths, both chrome and
nyc(istanbul)
are able to locate the source and generate a relevant report - Istanbul doesn't complain about not being able to locate files"sources":["../../../projects/shared-modules/src/lib/utils/string-utils.ts",
How To Reproduce
See the
dist/my-lib/fesm5/my-lib.js.map
file and see thesources
arrayExpected Behaviour
Other programs should be able to locate the source files - not sure the best way around that...
Version Information
The text was updated successfully, but these errors were encountered: