找到了链接Sails JS with EJS but linker to compile handlebars public templates,它看起来很直,但不知怎么的,它不适用于我目前的帆船版本与玉石。
以下是任务/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');
};我看得出来,这个任务是由葛朗特负责的
> sails lift --prod
.....
Grunt :: Running "emberTemplates:dev" (emberTemplates) task但是文件./tmp/public/templates.js从未被创建。
我把头撞在墙上8个小时,不知道该去哪里。任何帮助都会被接受。谢谢
发布于 2014-09-23 15:30:09
问题是dev:节。当我删除dev:部分时,它就开始工作了:
module.exports =函数(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');
};https://stackoverflow.com/questions/25983012
复制相似问题