vendredi 7 août 2015

grunt.js ember-template-compiler not working

I am confused with this. I have the grunt-ember-templates plugin, and it used to work. But I did a npm install and it got messed up. Now it does not compile.

The error is this:

Running "watch" task
Waiting...
>> File "resources\hbs\index\module.hbs" changed.
Running "emberTemplates:compile" (emberTemplates) task
>> ReferenceError: ember-template-compiler.js:22258
>>   module.exports = Ember.__loader.require("ember-template-compiler");
>>   ^
>> module is not defined
Warning: Ember Handlebars failed to compile resources/hbs/error.hbs. Use --force to continue.

Aborted due to warnings.

My Gruntfile.js looks somehow like this:

module.exports = function(grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        emberTemplates: {
            compile: {
                options: {
                    templateBasePath: /resources\/hbs\//,
                    // Path to the ember-template-compiler of my ember version
                    templateCompilerPath: 'resources/js/libs/ember-template-compiler.js',
                    handlebarsPath: 'node_modules/handlebars/dist/handlebars.js'
                },
                files: {
                    'resources/js/templates.js': 'resources/hbs/**/*.hbs'
                }
            }
        },
...

Any idea? thanks in advance.




Aucun commentaire:

Enregistrer un commentaire