Sails.js,Ember,Handlebars和配置通过grunt-ember-templates:模板文件未创建

时间:2014-09-22 20:59:07

标签: sails.js handlebars.js grunt-ember-templates

找到链接Sails JS with EJS but linker to compile handlebars public templates 而它看起来很直接,但不知何故它不适用于我目前的帆版本与玉

这里是tasks / config / emberTemplates.js中当前的Grunt配置

module.exports = function (grunt) {

grunt.config.set('emberTemplates', {
  dev: {
    compile: {
      options: {
        amd: true,
        templateBasePath: /assets\/templates\//
      },
      files: {
      ".tmp/public/templates.js": ['assets/templates/**/*.hbs']
    }
  }
 }
});
  //console.log('loading grunt-ember-template');
  grunt.loadNpmTasks('grunt-ember-templates');
};

我可以看到Grunt在

上接受了这项任务
 > sails lift --prod

 ..... 
 Grunt :: Running "emberTemplates:dev" (emberTemplates) task

但是文件./tmp/public/templates.js永远不会被创建。

我把头撞在墙上8小时,不知道该往哪里走。 任何帮助都是相关的。 感谢

1 个答案:

答案 0 :(得分:2)

问题是dev:section ..一旦我删除了dev:部分就可以了:

module.exports = function(grunt){

grunt.config.set('emberTemplates', {
  compile: {
     options: {
     amd: false,
     templateBasePath: /assets\/templates\//
     },
  files: {
  ".tmp/public/templates.js": ['assets/templates/**/*.hbs']
    }
 });

grunt.loadNpmTasks('grunt-ember-templates');
};
相关问题