Suppose we implement a service similar to this as part of a library:
@Injectable({ providedIn: 'root' })
export class ChartJSProvider {
constructor() {
Chart.register(...registerables);
}
}
and our application makes use of the aforementioned library.
Will the singleton instance of ChartJSProvider
be automatically generated and included in all instances of the Angular application that are currently running even if it is not explicitly injected into any component used by the app, or will it be optimized out during tree shaking?