grunt-copy-deps
Copy
package.json
dependencies fromnode_modules
to a destination of your choosing
Getting Started
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-copy-deps --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt;
copydeps task
Run this task with the grunt copydeps
command.
Options
minified
Type: Boolean
Default: true
Copy the minified version of each dependency.
unminified
Type: Boolean
Default: false
Copy the unminified version of each dependency.
ignore
Type: Array
Default: []
An array containing the name of the dependencies (as listed in your package file) that should be ignored.
exclude
Type: Object
Default: { js: [], css: [] }
An object identifying the .js
and/or .css
files that should not be copied.
include
Type: Object
Default: { js: {}, css: {} }
An object identifying the .js
and/or .css
files that should also be copied along with other dependency files.
js
Type: Boolean
Default: true
Determines whether or not .js
files for all dependencies should be copied.
css
Type: Boolean
Default: false
Determines whether or not .css
files for all dependencies should be copied.
Examples
Add a section named copydeps
to the data object passed into grunt.initConfig()
.
Copying only .min.js
dependencies:
grunt;
Copying only .js
dependencies:
grunt;
Copying both .min.js
and .js
dependencies:
grunt;
Copying both .js
and .css
dependencies:
grunt;
Copying only .css
dependencies:
grunt;
Copying with some dependencies ignored:
grunt;
Copying with excluded files:
grunt
Copying with included files:
grunt
The copydeps
task will look for dependencies
listed in your package file, and these dependencies will be copied into your dest
folder.