I have created angular 7 library with ng g library @my-org/some-lib
and use it in separate angular app by npm link
to be able to develop both app and a library.
Now I found that in dev tools I see the library as a separate my-org-some-lib
bundled js file resolved from the vendor.js.map
yet it is not resolving further to the sourceMappingURL=my-org-some-lib.js.map
which exists in the my-org-some-lib.js
and the map file is actually generated in a builded library.
after some time of dealing with combined library sources finally I found a solution:
angular.json
in projects.app.architect.build.options
path there need to include "options": {
"sourceMap": true,
"vendorSourceMap": true,
"preserveSymlinks": true, // <-- bonus - to use npm link'ed libraries
// ...
// note that json format does not allows comments ;)
}
"configurations": {
"production" :{
"sourceMap": false
// ...
}
}
@angular-devkit/build-angular
, version >= 0.801.3 should work okthe above solution is taken from https://github.com/angular/angular-cli/issues/15531