lbrahim
lbrahim

Reputation: 3810

Grunt and Bower Dependency Management

I am new to whole front-end tooling and I am trying to start a new jquery plugin project. So, with Grunt I used grunt-init-jquery to make me a boilerplate jquery plugin project and it already has unminified versions of client framework dependecies as well such as jquery and qunit.

It also generates package.json which I can edit to contain dependencies so, how does Bower fit here? or is optional and I can handle both server and client side dependencies with Grunt only?

Upvotes: 1

Views: 790

Answers (1)

Preview
Preview

Reputation: 35796

I think you are confusing Grunt with Npm, because the Grunt cannot handle dependencies, it's "simply" a task runner. The package.json file is here because you need the devDependencies for the Grunt installation and all its plugins (like grunt-contrib-concat). This file is associated with Npm and not specifically Grunt.

Bower is solely for front-end dependencies. Even if you can handle them with Npm, it's better to use Bower since it's optimized for this purpose (no deep dependencies among other things).

So manage the things you need for the development of your plugin with Npm, and Bower for your plugin dependencies (since a jQuery plugin is usually for the front-end).

Upvotes: 1

Related Questions