svnm
svnm

Reputation: 24328

Would bower only be useful for css if using browserify and node.js commonJs

I see from this stack overflow question the difference between bower and npm:

npm is used for managing Node.js modules, but can work on the front-end too when combined with Browserify or WebPack. npm does nested dependency tree, so your dependencies can have their own dependencies which can have their own... which basically can mean a lot of versions of the same modules together, but not a problem on the server, and Browserify handles this by only bundling the appropriate modules.

Bower is used for the front-end only and is optimized with that in mind. It requires a flat dependency tree, putting the burden of dependency resolution on the user, which makes sense on the client as we want to minimize the number of includes,

My question:

If we are using Browserify, Is there much point to using bower for managing front end dependencies, other than the following 2 benefits?

Upvotes: 4

Views: 973

Answers (1)

Rubén Norte
Rubén Norte

Reputation: 416

You can also get the 2 benefits you mention using npm:

  • Bootstrap and PureCSS are available as npm packages
  • You can install large libraries with npm and create separate bundles for them using Browserify

This is also a debate we are having in my company and I am starting to opt for a npm-only approach.

More on this:

Upvotes: 2

Related Questions