Hello!
I have built a custom angular library that's currently on v17.3.12. It contains several stand-alone components. I'm struggling to make it tree shakable and am not sure where else to look. Is there anyone here with experience building custom libraries that could help me out?
I've followed several tutorials, including this one:
https://angular.dev/tools/libraries/creating-libraries#refactoring-parts-of-an-application-into-a-library
Each component is in its own separate module. For example:
icon.module.ts
@NgModule({
declarations: [
IconComponent
],
imports: [
CommonModule
],
exports: [
IconComponent
]
})
export class IconModule {}
This module is then exported at the root module.ts file. The file public-api.ts also exports icon.component.ts.
The application that uses this library will include code for this icon component whether it uses it or not. Is there someone who would be able to guide me through this? I think I'm close, but have got to be missing something simple.
Thanks,
The Ben