1

我在 AngularJS 项目中使用grunt-contrib-coffee,我正在尝试根据 grunt 的目标设置配置选项。我有以下配置文件(使用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'
      }
    }
  };
};

grunt coffee:stage但是当我使用不复制文件执行任务时。有任何想法吗?

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

Done, without errors.

谢谢!

4

1 回答 1

1

的正确配置grunt-config-coffee需要以 开头coffee,然后根据您的情况使用特定配置(使用stage而不是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'
      }
    }
  };
};
于 2015-04-08T12:27:27.763 回答