I've been using the ng build my-lib --watch for some time now but I 've been unhappy with the rebuild time.
Today I changed the default path mapping in main project's tsconfig to point to lib's public_api:
"paths": {
"users": [
"projects/users/src/public_api"
],
"shared": [
"projects/shared/src/public_api"
]
}
now the libraries are built by ng serve command, changes propagates super fast and also the Chrome devtools are able to debug raw typescript files.
Sounds too good to be true but really works.
Originally posted by @GeorgeKnap in #10643 (comment)
How to use one library project with another
After this changes how to resolve dependency if "shared" library is used inside "users" library.
Getting below error while ng build users
error TS6059: File '....projects/shared/src/lib/com-model.component.ts' is not under 'rootDir' '...\projects\users\src'. 'rootDir' is expected to contain all source files.
I've been using the
ng build my-lib --watchfor some time now but I 've been unhappy with the rebuild time.Today I changed the default path mapping in main project's tsconfig to point to lib's public_api:
now the libraries are built by
ng servecommand, changes propagates super fast and also the Chrome devtools are able to debug raw typescript files.Sounds too good to be true but really works.
Originally posted by @GeorgeKnap in #10643 (comment)
How to use one library project with another
After this changes how to resolve dependency if "shared" library is used inside "users" library.
Getting below error while
ng build userserror TS6059: File '....projects/shared/src/lib/com-model.component.ts' is not under 'rootDir' '...\projects\users\src'. 'rootDir' is expected to contain all source files.