Wrangle those bower dependencies and place each one where it's supposed to be.
- Consistently positions your dependencies where you want them in your repository.
- Conveniently facilitates tracking your dependencies without committing the entire Bower components folder.
bower_componentsdirectory in your build to make it work. This plugin clears the detritus.
Whenever you add a new bower dependency, add which file should be copied and where to your Gruntfile
"bowercopy" config. Then, run
By default, bowercopy runs
bower install for you (turn this off with the
runbower option). Your bower directory is not removed so you can see which files you need from each component.
It is suggested that you add the bower directory (usually
'bower_components') to your
This plugin requires Grunt.
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 grunt-bowercopy --save-dev
Note: have a look at load-grunt-tasks so you can skip this step for all your grunt plugins.
The "bowercopy" task
In your project's Gruntfile, add a section named
bowercopy to the data object passed into
Default value: The
directory property value in your
'bower_components' if the
.bowerrc cannot be found.
srcPrefix will prefix your source locations with the correct bower folder location.
destPrefix will be used as the prefix for destinations.
bower install in conjunction with the
Report any modules in your bower.json that have not been configured to copy at least one file with
Note: The clean option reports the same thing, so this option is ignored if clean is true.
Removes the bower components directory on completion. The folder path that is removed is
Note: the directory will only be removed if the following conditions are met.
- All task targets are run (i.e. grunt-bowercopy was run with the command
grunt bowercopyand not
- At least one thing was copied from each bower component (grunt-bowercopy tracks this for you).
grunt-bowercopy tracks which dependencies have at least one file copied.
ignore option can be used to specify any bower dependencies that aren't copied, but need to be defined in your
Options to pass to
grunt.file.copy when copying the files. See grunt.file.copy
Follow the same coding style present in the repo and add tests for any bug fix or feature addition.
See the CONTRIBUTING.md for more info.
- 1.1.0 (6-23-2014) Add :main pragma and
- 1.0.1 (6-12-2014) Updated node modules
- 1.0.0 (3-26-2014) Version 1
- 0.9.0 (3-3-2014) Warn if a source location was not found.
- 0.8.0 (2-21-2014) Adds support for folders for destinations when copying individual files.
- 0.7.1 (1-20-2014) Fix Windows issue with path seperators.
- 0.7.0 (1-13-2014) Add
options.runBower. Fix an issue with a source format (gh-9).
- 0.6.0 (1-13-2014) Add glob matcher.
- 0.5.0 (12-31-2013) Add
options.copyOptionsto be passed along to
grunt.file.copyand fix issue with local-only bower usage.
- 0.4.0 (12-3-2013) Update grunt to 0.4.2. Add the ability to copy folders.
- 0.3.0 (12-2-2013) Add clean option for removing the bower components directory on full task completion.
- 0.2.0 (11-19-2013) Report any bower components not configured to be copied when all targets are run together.
- 0.1.0 (11-19-2013) First Release
Copyright (c) 2014 Timmy Willison. Licensed under the MIT license.