Hacker News new | ask | show | jobs
by TomFrost 4039 days ago
This article digs on the flattened dependency model like it's a huge weakness of Bower, but this is the _entire point_ of Bower.

You include two models that both depend on two different versions of jQuery. NPM wouldn't complain at all, Browserify would happily package both dependencies up, and now your users are downloading jQuery twice to view your page.

Bower, conversely, raises a red flag right away, and lets you determine what should be done here in the event that the package definition doesn't contain enough info to sort this out automatically. Its goal is to make your client code as minimal as possible.

Feature, not bug.

1 comments

Npm/browserify will load only one copy of jQuery if the semvers match. The only "problem" with that is that if you get duplicates, npm doesn't report these out of the box. It's rather easy to write a script to detect these (if one doesn't exist already).