import 'library'; import * as library from 'library'; import library from library; import {method} from library;
Webpack Bundle Analyzer
https://www.npmjs.com/package/webpack-bundle-analyzer
https://bundlephobia.com
Source Map Explorer
https://www.npmjs.com/package/source-map-explorer
const toastrFactory = () => import('toastr').then(p => p.default); type LazyToastr = ReturnType<typeof toastrFactory>; const TOASTR = new InjectionToken<LazyToastr>('Lazily loaded toastr', { providedIn: 'root', factory: toastrFactory });
Полный пример тут
https://stackblitz.com/edit/angular-ivy-lazy-toastr-example?file=src%2Fapp%2Fapp.component.ts
Guess JS
By Sergey Mell