Tree Shaking Angular Library

Hey all, Angular libraries with Tree-Shaking question.

I’ve been reading the ng-packagr docs and it’s unclear to me, do I need to setup my public-api.ts file in a way to enable tree-shaking? For example, if I put everything in a single public-api.ts file, it seems like the user imports like this:

import { LibraryService } from 'my-library';
class UserComponent {
  constructor(foo: LibraryService) {}

I would assume my module needs to be imported like this to be tree shakable (Example from Material):

import {CdkTreeModule} from '@angular/cdk/tree';

It seems like what I’m looking for is a secondary entry point:

But in these examples, they still have a primary-entry-point public-api.ts

The docs do not mention tree-shaking though. Is the primary-entry-point still tree-shaken based on what you do/do-not use?

Update, Kevin Kreuzer answers this question in-depth here:

@erxk_verduin, can you include a quote from the article that answers your question?