grunt-bower
Grunt plugin for Bower, a package manager for the web.
Getting Started
This plugin requires Grunt ~0.4.1
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install dherges/grunt-bower --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-bower');
The "bower" task
Overview
In your project's Gruntfile, add a section named bower
to the data object passed into grunt.initConfig()
.
What command is being executed is either given through the target name or explicitly through the command
option.
grunt.initConfig({
bower: {
install: {
options: {
},
args: [
]
},
your_second_target: {
command: 'list',
options: {},
args: []
}
}
})
Options
command
Type: String
Default value: ''
If set, comand
gives the bower command that is executed. For now, install
and list
are known to be useful commands for this plugin, though all commands of Bower's programmatic API are available.
options
Type: Object
Default value: {}
Options for the bower command being executed; see http://bower.io for a list of available options.
arguments
Type: Array
Default value: []
Arguments for the bower command being executed; see http://bower.io for a list of available arguments.
Usage Examples
Install
In this example, we run a simple bower install
.
grunt.initConfig({
bower: {
install: {
}
}
})
List pathes
In this example, we run bower list --paths
.
grunt.initConfig({
bower: {
consumePaths: {
command: 'list',
options: {
paths: true
}
}
}
});
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
Release History
- 2013-07-11 v0.1.0 First version.