0

This might have been asked before but the places I've checked doesn't seem to solve my problem.

I'm trying to compile my LESS files through Grunt as CSS. This is the original code I wrote, which works,

less: {
  build: {
    options: {
      compress: true
    },
    files: {
      'css/less.min.css' : ['less/less/css']
    }  
  }
}

Whereas replacing the information within the files object to this...

'css/less.min.css' : ['less/less/css']

...gives me the cmd error saying this,

Fatal error: Unable to create directory "DIRECTORY_PATH\css\**"

Following the advice from this link seemed to make sense, which I wrote as,

less: {
  build: {
    options: {
      compress: true,
      paths: ["less/"]
    },
    files: {
      expand: true,
      cwd: 'less/',
      src: ['*.less'],
      dest: 'css/',
      ext: '.css'
    }  
  }
}

which gives me the command errors,

Warning: Object true has no method 'indexOf' Use --force to continue

&

Aborted due to warnings.

Using --force doesn't make a difference and I don't know what the warnings are.

I tried using assemble-less, but it came with the same results, not rendering the CSS.

How can I fix this?

Community
  • 1
  • 1
Joshua Waheed
  • 277
  • 4
  • 16
  • Maybe this could help: http://stackoverflow.com/questions/15094667/compile-less-files-with-grunt-contrib-less-wont-work – YuS Sep 17 '14 at 13:28

1 Answers1

1

Put the files in array

  files: [{
      expand: true,
      cwd: 'less/',
      src: ['*.less'],
      dest: 'css/',
      ext: '.css'
  }]  
Sami
  • 3,926
  • 1
  • 29
  • 42