Chapter 4. Dependency management with Bower

 

This chapter covers

  • An introduction to dependency management
  • Bower as a front-end dependency manager
  • Flat versus nested dependency trees
  • Gulp plugins for Bower integration

After creating a solid build definition file for Gulp, you’re ready to move on to the next step in your new front-end development workflow: dependency management.

Dependencies are self-contained and reusable code packages. You don’t want to change the code but simply want to use it. The packages include frameworks like Bootstrap or jQuery but also smaller components like carousels or various widgets you want to include in your application. The latter ones also might have dependencies of their own. And those might be dependent on one of the frameworks you’re already using.

The more code you use, the harder it gets to keep track of. Imagine having 10 jQuery plugins on your website and trying to update the main framework to a newer version. It’s hard to ensure that all of the plugins still work with the new jQuery release.

This is where dependency managers come in. Tools like Bower help you to install, search for, and update dependencies, as shown in figure 4.1. They also keep an eye on cross-references and possible version conflicts with other frameworks and components you’ve installed.

4.1. Dependency management basics

 

4.2. Flat dependency tree management with Bower

 
 
 

4.3. Integration with Gulp

 
 
 
 

4.4. Summary

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest