Marcos Chicote
Marcos Chicote

Reputation: 315

Target using grunt-contrib-coffee

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!

Upvotes: 1

Views: 74

Answers (1)

frhd
frhd

Reputation: 10284

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'
      }
    }
  };
};

Upvotes: 1

Related Questions