|
|
{ "name": "grunt-bower-task", "description": "Install Bower packages.", "version": "0.2.2", "homepage": "https://github.com/yatskevich/grunt-bower-task", "author": { "name": "Ivan Yatskevich", "email": "ivan@yatskevich.com" }, "contributors": [ { "name": "Maksim Horbachevsky", "url": "https://github.com/fantactuka" } ], "repository": { "type": "git", "url": "git://github.com/yatskevich/grunt-bower-task.git" }, "bugs": { "url": "https://github.com/yatskevich/grunt-bower-task/issues" }, "licenses": [ { "type": "MIT", "url": "https://github.com/yatskevich/grunt-bower-task/blob/master/LICENSE-MIT" } ], "main": "Gruntfile.js", "engines": { "node": ">= 0.8.0" }, "scripts": { "test": "grunt test" }, "dependencies": { "bower": "~0.8.5", "lodash": "~0.10.0", "rimraf": "~2.0.2", "wrench": "~1.4.3", "colors": "~0.6.0-1", "async": "~0.1.22" }, "devDependencies": { "grunt-contrib-jshint": "0.3.0", "grunt-contrib-nodeunit": "~0.1.2", "grunt": "~0.4.1", "grunt-cli": "~0.1.6" }, "keywords": [ "gruntplugin", "bower" ], "readme": "# grunt-bower-task [![Build Status](https://travis-ci.org/yatskevich/grunt-bower-task.png)](https://travis-ci.org/yatskevich/grunt-bower-task)\n\n> Install Bower packages. Smartly.\n\n## Getting Started\n_If you haven't used [grunt][] before, be sure to check out the [Getting Started][] guide._\n\nPlease note, this plugin works **only with grunt 0.4+**. If you are using grunt 0.3.x then consider an [upgrade to 0.4][].\n\nFrom the same directory as your project's [Gruntfile][Getting Started] and [package.json][], install this plugin with the following command:\n\n```bash\nnpm install grunt-bower-task --save-dev\n```\n\nOnce that's done, add this line to your project's Gruntfile:\n\n```js\ngrunt.loadNpmTasks('grunt-bower-task');\n```\n\nIf the plugin has been installed correctly, running `grunt --help` at the command line should list the newly-installed plugin's task or tasks. In addition, the plugin should be listed in package.json as a `devDependency`, which ensures that it will be installed whenever the `npm install` command is run.\n\n[grunt]: http://gruntjs.com/\n[Getting Started]: https://github.com/gruntjs/grunt/wiki/Getting-started\n[package.json]: https://npmjs.org/doc/json.html\n[upgrade to 0.4]: https://github.com/gruntjs/grunt/wiki/Upgrading-from-0.3-to-0.4\n\n## Grunt task for Bower\n\n### Overview\nIn your project's Gruntfile, add a section named `bower` to the data object passed into `grunt.initConfig()`.\n\n```js\ngrunt.initConfig({\n bower: {\n install: {\n //just run 'grunt bower:install' and you'll see files from your Bower packages in lib directory\n }\n },\n})\n```\n\n### Options\n\n#### options.targetDir\nType: `String`\nDefault value: `./lib`\n\nA directory where you want to keep your Bower packages.\n\n### options.install\nType: `Boolean`\nDefault value: `true`\n\nWhether you want to run bower install task itself (e.g. you might not want to do this each time on CI server).\n\n### options.cleanTargetDir\nType: `Boolean`\nDefault value: `false`\n\nWill clean target dir before running install.\n\n### options.cleanBowerDir\nType: `Boolean`\nDefault value: `false`\n\nWill remove bower's dir after copying all needed files into target dir.\n\n#### options.cleanup\nType: `boolean`\nDefault value: `undefined`\n\n**NOTE:** If set to true or false then both `cleanBowerDir` & `cleanTargetDir` are set to the value of `cleanup`.\n\n#### options.layout\nType: `string` or `function`\nDefault value: `byType`\n\nThere are two built-in named layouts: `byType` and `byComponent`.\n\n`byType` layout will produce the following structure:\n\n```\nlib\n|-- js\n| |- bootstrap\n| \\- require\n|-- css\n \\- bootstrap\n```\nwhere `js`, `css` come from `exportsOverride` section described below.\n\n`byComponent` will group assets by type under component name:\n\n```\nlib\n|-- bootstrap\n| |- js\n| \\- css\n|-- require\n \\- js\n```\n\nIf you need to support custom layout then you can specify `layout` as a function of `type` and `component`:\n\n```js\nvar path = require('path');\n\ngrunt.initConfig({\n bower: {\n install: {\n options: {\n layout: function(type, component) {\n var renamedType = type;\n if (type == 'js') renamedType = 'javascripts';\n else if (type == 'css') renamedType = 'stylesheets';\n\n return path.join(component, renamedType);\n }\n }\n }\n }\n});\n```\n\n#### options.verbose\nType: `boolean`\nDefault value: `false`\n\nThe task will provide more (debug) output when this option is set to `true`. You can also use `--verbose` when running task for same effect.\n\n### Usage Examples\n\n#### Default Options\nDefault options are good enough if you want to install Bower packages and keep only `\"main\"` files (as specified by package's `component.json`) in separate directory.\n\n```js\ngrunt.initConfig({\n bower: {\n install: {\n options: { \n targetDir: './lib',\n layout: 'byType',\n install: true,\n verbose: false,\n cleanTargetDir: false,\n cleanBowerDir: f "readmeFilename": "README.md", "_id": "grunt-bower-task@0.2.2", "_from": "grunt-bower-task@~0.2.2" }
|