Reputation: 2337
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.
Upvotes: 6
Views: 3041
Reputation: 18583
what worked for me was this from here https://angular.io/guide/workspace-config#source-map-configuration
"sourceMap": {
"scripts": true,
"styles": true,
"hidden": false,
"vendor": true
}
Upvotes: 4
Reputation: 2337
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
Upvotes: 2