2
votes

Found the link Sails JS with EJS but linker to compile handlebars public templates and it looks straight forward but somehow it does not work with my current sails version with jade

Here's the current Grunt Configuration in tasks/config/emberTemplates.js

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

I can see that the task gets picked up by Grunt on

 > sails lift --prod

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

But the file ./tmp/public/templates.js never gets created.

I banged my head against the wall for 8 hours and don't know where to go. Any help is apreciated. Thanks

1

1 Answers

2
votes

The issue was the dev: section.. as soon as I removed the dev: section it worked:

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