npm.io
0.1.4 • Published 10 years ago

grunt-copy-modified

Licence
Version
0.1.4
Deps
2
Vulns
0
Weekly
0

grunt-copy-modified NPM version

Grunt copy plugin, only copy modified files. using node-glob!

Getting Started

This plugin requires Grunt ~0.4.5

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-modified --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-copy-modified');

The "copy_modified" task

Overview

In your project's Gruntfile, add a section named copy_modified to the data object passed into grunt.initConfig().

grunt.initConfig({
	copy_modified: {
		your_target: {
			files: [{
					src: ['path/**/*.js', 'path/**/*.css'],
					dest: 'dest/',
					ignore: ['**/*.less', '**/*.scss', '**/*.coffee']
				}, // includes files in path and its subdirs
				{
					cwd: 'path',
					src: ['**/*.js', '**/*.css'],
					dest: 'dest',
					ignore: ['**/*.less', '**/*.scss']
				} // makes all src relative to cwd 
			],
			verbose: true,
			expand: true,
			debug: false,
			dot: false,
			nodir: true
		}
	},
});
Usage Examples
grunt.initConfig({
	copy_modified: {
		your_target: {
			files: [{
					cwd: 'dev',
					src: ['**/*.js', '**/*.css', '**/*.html'],
					dest: 'dest',
					ignore: ['**/*.less', '**/*.scss', '**/*.coffee']
				} // makes all src relative to cwd 
			],
			verbose: false,
			expand: true,
			debug: false,
			dot: false,
			nodir: 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

(Nothing yet)