Вопрос

Having a problem with Grunt and Copying files.

When adding the expand true this line of code it is completely skipped over.

{
   expand:true, 
   flatten: true, 
   src: ['bower_components/****/bootstrap/less/*.less'], 
   dest: 'codebase/assets/less/'
}

I am using both --verbose and --stack to see where the issue is and there is no error when running the code.  

When the expand true is taken out the files are copied over but the parent directories are added in.  So it seems to me there is an issue with the expand: true option here.

I have tried with 'cwd' and 'src' being set to '*' as well and it doesn't work either.

Это было полезно?

Решение

Try adding filter: 'isFile' to your config: i.e.

copy: {
    bootstrap: {
        expand: true,
        flatten: true,
        src: ['bower_components/**/bootstrap/less/*.less'],
        dest: 'codebase/assets/less/',
        filter: 'isFile'
    }
}
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top