1ManStartup
1ManStartup

Reputation: 3826

Compiled .Jade to .JS...How To Use As Backbone Template in Require.JS?

So I compiled .Jade to .js. How would I use a .js template in backbone.js with require.js? Ive tried something like this:

define(['marionette'], 
function(Marionette) {

return CoreNorthLayout = Backbone.Marionette.Layout.extend({
  template: require('/to/folder/templatename')
});

});

But no work, anything else I can try? Thanks.

Upvotes: 0

Views: 345

Answers (1)

Peter Lyons
Peter Lyons

Reputation: 146154

Jade is going to generate just a single javascript function source code: function anonymous(locals){...}. You need to wrap this with an AMD wrapper to use it with requirejs.

Upvotes: 1

Related Questions