AngularInDepth is moving away from Medium. More recent articles are hosted on the new platform inDepth.dev. Thanks for being part of indepth movement!

Angular is an awesome framework. We all love it 😍

One thing that makes Angular successful and excellent at the same time is the vast community and the value it provides. There are a lot of Angular meetups, blogs, conferences, and of course, libraries.

Nowadays, thanks to the Angular CLI, libraries are easy to create. They are a great way to share code across multiple applications.

Since they can be used in many places, performance is a critical aspect. A library that doesn’t perform can slow down multiple applications!

In Frontend, there are different types of performance. Runtime performance and initial load. In this article, we will focus on initial load.

While providing and maintaining various libraries and a UI framework for a big enterprise, I encountered some not so apparent pitfalls and ways to deal with them. I think it’s worth sharing some of those experiences.

💬 “It’s such a simple library. It can’t affect performance, right?”

Let’s start with a simple library that we generate with the help of the Angular CLI. In case you have never created an Angular library, it might be helpful to read the following article:

Once we used the CLI to set up the multi-project workspace, we can start to add some code.