Understanding the Frontend Dependencies

Learn to explore and understand frontend dependencies in this chapter.

We'll cover the following

Frontend dependencies

Earlier, we learned that frontend dependencies are defined in package.json. Why not just list all the dependencies as script tags in index.html? Why do we need the extra complexity of npm package management in our project? The answer is that a long list of dependencies is hard to manage. If we used script tags, we’d need to make sure these are ordered correctly. We’d also be responsible for downloading the packages, placing them locally in our project, and keeping them up to date. We have a huge list of dependencies in our scaffolded project already, without starting work on any functionality in our app. For these reasons, managing dependencies with npm has become an industry standard.

Let’s open package.json again and look at the dependencies section:

Get hands-on with 1200+ tech skills courses.