javascriptgruntjssails.jsgrunt-contrib-copy

Remove Original file after rename with grunt_copy


I want to delete original file after rename file with grunt copy option. File successfully renamed However, original file stay without deleting. Find my code below.

rename: {
        files: [
            {
                expand: true,
                flatten: true,
                cwd: '.tmp/public/min',
                src: ['production.*.*'],
                dest: '.tmp/public/min/',
                rename: function(dest, src) {
                return dest + src.replace('production','production.v'+timestamp);
            }
            }]
    },

Here is the module I use,

grunt-contrib-copy

Solution

  • you can use grunt-contrib-clean to remove the file.