EzDevInfo.com

generator-backbone

Scaffold out a Backbone.js project The web's scaffolding tool for modern webapps | Yeoman

How to use JST namespace in generator-backbone?

By default (in project's grunt file) the templates.js file located in .tmp directory (generator-backbone), so am I missing something or this feature just don't work out of the box and I need to put additional paths in require.config?

Obviously if I will not add anything the JST will not be defined, right?

Note that I initiated the projects with Handlebars as the templating framework.


Source: (StackOverflow)

Using handlebars-compile with Yeomans generator-backbone template

I am using Yeomans generator-backbone to build a site.

I have decided to include handlebars as a templating language as I am familiar with it and have leveraged it's partials to create sub templates ( it works for me ).

I am only using handlebars-compile not leveraging the actual templating language, yet.

In past projects I have used very simple configurations for handlebars for example:

'compile-handlebars': {
    dev: {
        template: './templates/*.hbs',
        partials: './templates/snipits/**.hbs',
        output: './*.html'
    }, 
}

Then calling it in my grunt task obviously, this works.

In my current project ( using generator-backbone ) by Yeoman I have included the following into my grunt file and attempted to call it from the 'serve' task.

'compile-handlebars': {
    dev: {
        template: '<%= yeoman.app %>/scripts/templates/*.handlebars',
        partials: ['<%= yeoman.app %>/scripts/templates/partials/*.hbs'],
        output: '<%= yeoman.app %>'
    }
},

So based on my limited knowledge this should work.

Unfortunately when I run grunt serve --verbose I get an error, I have searched this extensively but can't find anything related directly to my situation.

Error is as follows:

Running "compile-handlebars:dev" (compile-handlebars) task
Warning: Arguments to path.join must be strings Use --force to continue.

How do I go about debugging this issue or Is there a guide to using these technologies together in the same way I am.

I am not sure how to approach this, any advice would be appreciated.

Cheers.


Source: (StackOverflow)

Advertisements