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
you can use grunt-contrib-clean
to remove the file.