将grunt任务添加到linemanjs application.js

时间:2014-02-02 16:27:20

标签: gruntjs linemanjs

我想在我的lineman application.js文件中添加一个grunt任务(特别是angular-template)。找到了一些文档herehere。但是,它只是告诉我将grunt任务添加到loadNpmTasks。问题是从使用lineman创建的新项目中,我的application.js文件没有loadNpmTasks数组,注释也没有指出我应该放在哪里。我在文档中找到的两个示例都没有显示application.js文件的整体外观。

1 个答案:

答案 0 :(得分:0)

application.js文件看起来应该是这样的(显然src / dest选项没有正确配置:

module.exports = function(lineman) {
  return {
    loadNpmTasks:['grunt-angular-templates'],

    ngtemplates:  {
        app:        {
            src: '**.html',
            dest: 'templates.js'
        }
    }
  };
};

然后运行任务:

lineman grunt ngtemplates