1

I'm using grunt-contrib-coffee in an AngularJS project and I'm trying to set configuration options based on grunt's target. I have the following configuration file (using grunt-load-options):

'use strict';

module.exports = function(grunt) {
  return {
    stage: {
      glob_to_multiple: {
          expand: true,
          nonull: true,
          cwd: 'src/js/',
          src: ['*.coffee', 'config/stage.coffee'],
          dest: '.tmp/js/',
          ext: '.js'
      }
    }
  };
};

But when I execute the task using grunt coffee:stage no files are copied. Any ideas?

Running "coffee:stage" (coffee) task
>> 0 files created.

Done, without errors.

Thanks!

frhd
  • 9,396
  • 5
  • 24
  • 41
Marcos Chicote
  • 315
  • 2
  • 11

1 Answers1

1

A correct configuration for grunt-config-coffee would need to start with coffee, and then, as in your case, with the specific config (use stage instead of glob_to_multiple):

module.exports = function(grunt) {
  return {
    coffee: {
      stage: {
          expand: true,
          nonull: true,
          cwd: 'src/js/',
          src: ['*.coffee', 'config/stage.coffee'],
          dest: '.tmp/js/',
          ext: '.js'
      }
    }
  };
};
frhd
  • 9,396
  • 5
  • 24
  • 41
  • I'm still getting an error: Running "coffee:stage" (coffee) task Verifying property coffee.stage exists in config...ERROR >> Unable to process task. Warning: Required config property "coffee.stage" missing. Use --force to continue. Aborted due to warnings. – Marcos Chicote Apr 08 '15 at 15:36