From the course: Angular Performance Optimization Techniques
Unlock this course with a free trial
Join today to access over 25,600 courses taught by industry experts.
Removing unused dependencies and imports - Angular Tutorial
From the course: Angular Performance Optimization Techniques
Removing unused dependencies and imports
- [Instructor] So let's now talk about dependencies because as we saw earlier, dependencies can make a big part of our application and increase the size of what we ship to a browser. And what's very important to understand is that whenever you import something, whenever you use an import statement in your code like this, you're basically telling the compiler, I need this to be included in my build. So every time you do an import, you are making a vote saying, I need that code, I need all of that in order to compile my project. And so as a result, something that can be dangerous is to do something like what we do here. If you import everything, import * as something from a specific dependency, this can be dangerous, because most likely you're importing way too much at this point, you're importing a lot of, well, the entire package, even though you might be using just a subset of that. So I would say try avoiding this import * that would just bring too many dependencies along in your…