grunt-contrib-copy-only-newer

A grunt-contrib-copy filter that allows copying files, only if the source is newer.

Usage no npm install needed!

<script type="module">
  import gruntContribCopyOnlyNewer from 'https://cdn.skypack.dev/grunt-contrib-copy-only-newer';
</script>

README

grunt-contrib-copy-only-newer

Description

This module offers a function that allows configuring the grunt-contrib-copy task.

Usage

module.exports = function(grunt) {
    var onlyNewer = require('grunt-contrib-copy-only-newer')
                        .onlyNewerBuilder(grunt);
    // configuration for the plugins.
    grunt.initConfig({
        copy: {
            dist : {
                files: [
                    {
                        expand: true,
                        cwd: 'src/',
                        src: ['**'],
                        dest: 'dest/',
                        filter: onlyNewer("copy:dist") }
                ]
            }
        }
    });
    // following grunt configuration.
};