Copy files and folders for vegas-cmf assets
npm install grunt-vegas-assets-copy --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-vegas-assets-copy');
Run this task with the grunt vegas-assets-copy
command.
Task targets, files and options may be specified according to the grunt Configuring tasks guide.
grunt-contrib-copy Documentation.
copy: {
main: {
files: [
{
expand: true,
cwd_truncate: true,
cwd: 'vendor/vegas-cmf',
src: '*/assets/**',
dest: 'public/assets/'
},
],
},
},
If you want to avoid overwriting files, please define a filter field.
copy: {
main: {
files: [
{
expand: true,
cwd_truncate: true,
cwd: 'vendor/vegas-cmf',
src: '*/assets/**',
dest: 'public/assets/',
filter: function (filepath) {
var path = require('path');
var dest = path.join(grunt.config('copy.main.dest'), path.basename(filepath));
return !(grunt.file.exists(dest));
}
},
],
},
},