0

Update

Part of the problem is that front/styles contains both css and scss files. I only want to copy css files.

Original

So the copy task from grunt-contrib-copy should be doing one thing. Copying all the *.css files from front/styles and move them to front/build/styles

copy: {
  css: {
    files: {
      src: ['front/styles/*.css'],
      dest: 'front/build/styles/',
      filter: 'isFile'
    }
  }
},

I run grunt copy and it creates a folder called dest in the same level as the front folder. I go in to front/build/styles and nothing is there. This is a relatively easy task to config and have done so in the past but this is baffling to me.

What am I overlooking in the config?

Kylee
  • 1,625
  • 1
  • 31
  • 54

2 Answers2

0

Give this a shot:

copy: {
  css: {
    files: {
      cwd: 'front/styles/',
      src: '*.css',
      dest: 'front/build/styles/',
      filter: 'isFile'
    }
  }
},
Steven Britton
  • 197
  • 2
  • 5
  • This configuration now creates two folders `dest` like before and `cwd` which is new as the same level as the `front` folder. Both empty. Why is it ignoring the values I'm input, taking the task config params and creating them as empty directories? – Kylee May 08 '14 at 18:09
  • Silly question, but are you running compass before the copy task or after? Maybe the .css files do not exist yet in the part of the process? Can we see more of the grunt file? – Steven Britton May 08 '14 at 18:20
0

Figured this out.

copy: {
  css: {
    files: [
      {
        expand: true,
        flatten: true,
        src: 'front/styles/*.css',
        dest: 'front/build/styles/'
      }
    ]
  }
},
Kylee
  • 1,625
  • 1
  • 31
  • 54