Repository Link: https://github.com/andreElrico/mono-repo-test
Stackblitz Example: https://stackblitz.com/github/andreElrico/mono-repo-test (noop; only to navigate smoothly)
Assume the structure below:
root/
├── projects/
│ ├── app1
│ ├── app2
│ ├── app3
│ ├── app4
│ ├── lib1
- app1 - NOT FUNCTIONING << why am I unable to utilize the alias-path defined in root tsconfig? (
). It is a mix of"@lib1": ["projects/lib1/src/public-api"]
app2
andapp4
. - Error message for app1: `
ERROR in projects/app1/src/app/app.component.ts:7:3 - error NG8001: 'lib-lib1' is not a known element:
- If 'lib-lib1' is an Angular component, then verify that it is part of this module.
- If 'lib-lib1' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. (lib-lib1 component) `
- app2 - working - follows the recommended Angular approach. It uses a
tsconfig -> path
to access the dist/lib1 (library build output) - app3 - working - utilizes relative paths to the EXACT file location as suggested
- app4 - working - employs relative paths to the
public_api.ts
.
Why is app1
failing to compile successfully? That is the scenario I aim to resolve. Pathwise, everything seems correct :-/ ? The reason behind my desire to make app1
function is that I intend to submit a pull request on a library and a "test-app" already contains all imports in "library style" => (e.g. @lib1). Hence, it would be beneficial to map the standard nodemodule path of "@lib1" to the exact sources of the library present as siblings of this app. This way, I can quickly debug and develop a new feature. Naturally, I would remove @lib1 from package.json of the "test-app".