'angular library, secondary entry points with shared resources?

I'm trying to make an angular library with secondary entry points.

I have 2 entry points: input and select:

📦library
 ┣ 📂assets
 ┃ ┗ 📜_all.scss
 ┣ 📂select
 ┃ ┣ 📂src
 ┃ ┃ ┣ 📂components
 ┃ ┃ ┃ ┗ 📂error-list
 ┃ ┃ ┃ ┃ ┣ 📜error-list.component.html
 ┃ ┃ ┃ ┃ ┣ 📜error-list.component.scss
 ┃ ┃ ┃ ┃ ┗ 📜error-list.component.ts
 ┃ ┃ ┃ ┗ 📂select
 ┃ ┃ ┃ ┃ ┣ 📜select.component.html
 ┃ ┃ ┃ ┃ ┣ 📜select.component.scss
 ┃ ┃ ┃ ┃ ┗ 📜select.component.ts
 ┃ ┃ ┣ 📂models
 ┃ ┃ ┃ ┗ 📜select.model.ts
 ┃ ┃ ┣ 📜select.module.ts
 ┃ ┃ ┣ 📜public_api.ts
 ┃ ┃ ┗ 📜value-accessor-base.ts
 ┃ ┗ 📜package.json
 ┣ 📂input
 ┃ ┣ 📂src
 ┃ ┃ ┣ 📂components
 ┃ ┃ ┃ ┗ 📂error-list
 ┃ ┃ ┃ ┃ ┣ 📜error-list.component.html
 ┃ ┃ ┃ ┃ ┣ 📜error-list.component.scss
 ┃ ┃ ┃ ┃ ┗ 📜error-list.component.ts
 ┃ ┃ ┃ ┗ 📂input
 ┃ ┃ ┃ ┃ ┣ 📜input.component.html
 ┃ ┃ ┃ ┃ ┣ 📜input.component.scss
 ┃ ┃ ┃ ┃ ┗ 📜input.component.ts
 ┃ ┃ ┣ 📂models
 ┃ ┃ ┃ ┗ 📜input.model.ts
 ┃ ┃ ┣ 📜input.module.ts
 ┃ ┃ ┣ 📜public_api.ts
 ┃ ┃ ┗ 📜value-accessor-base.ts
 ┃ ┗ 📜package.json
 ┣ 📂src
 ┃ ┣ 📜public-api.ts
 ┃ ┗ 📜test.ts
 ┣ 📜.browserslistrc
 ┣ 📜.eslintrc.json
 ┣ 📜karma.conf.js
 ┣ 📜ng-package.json
 ┣ 📜package.json
 ┣ 📜README.md
 ┣ 📜tsconfig.lib.json
 ┣ 📜tsconfig.lib.prod.json
 ┗ 📜tsconfig.spec.json

As you can see here error-list.component is inside both entry points.

when I am trying to create a separate entry point shared for error-list.component, and then import error-list.component inside input and select from shared entry point, build fails with error: Error: not in root dir

How can I make this work, I mean how to have shared resources between secondary entry points? Or maybe there is some different workaround?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source