From the course: Creating Angular Libraries
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Entrypoints and code splitting - Angular Tutorial
From the course: Creating Angular Libraries
Entrypoints and code splitting
- [Instructor] All Angular libraries must have one primary entry point and any number of secondary entry points. Entry points are as much about developer experience as they are about keeping bundle size small. I opened our project here in a GitHub Codespace. I talk about why we use Codespaces earlier in this course, so for now, just think of them as an easy way to share and write code without installing anything on your local machine. From the root of our workspace, I'll go to projects, ngx-gem-finder and click on ng-package.json to open the file. The Angular CLI tool uses this file to figure out the entry points for your library and where to put the generated code. What you see here are the default settings when you scaffold a new library using the Angular CLI tool. The config file you see here represents the primary entry point because it lives in the root of our library project. We can add any number of secondary entry points by creating a new folder and adding an ng-package.json…