I'm maintaining an Angular 10 Ivy library and I'm attempting to upgrade it to make use of Secondary Entrypoints, but I'm running into trouble with folder structure of the final build.
Ideally, the folder structure would emulate @angular's folder structure of:
-node_modules
|
-- @angular
|
--core
--common
--cli
--material
...
and I could import pieces of the library like: import { someModule } from '@angular/core';
My current library builds with a folder structure of
-node_modules
|
--myLibrary
|
--package.json
--dist/myLibrary
|
--package.json
--public_api.ts
--myLibrary.d.ts
--feature1
--feature2
--feature3
...
which forces me to import features like import { feature1Module} from 'myLibrary/dist/myLibrary/feature1';.
I know I can remove the second myLibrary folder by updating the dest path in my myLibrary/ng-package.json, but the I don't know how to remove the dist folder to make everything build on the same level, as setting "dest": "../.." will fail to build.
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/myLibrary",
"assets": [
"quill/*.scss"
]
}
Any and all help is appreciated.
Update: The project structure is
-projects
|
--myLibrary
|
--package.json
--ng-package.json
--src
|
--public_api.ts
--commonFunctions
--feature1
|
--package.json
--src
|
--public_api.ts
--index.ts
--feature1.component.ts
--feature1.component.html
--feature1.module.ts
--feature2
--feature3
...
My projects/myLibrary/src/public_api.ts only exports the functions in commonFunctions and each of the public_api.ts files in each of the feature folders only exports the modules and components of their respective features.