Connect assets with handlebars?

447 Views Asked by At

The typical way to include the connect assets file is

!= css("main")

That is with .jade though. I am using handlebars and I have no clue how I can add the file?

I am using node-sass as well.

1

There are 1 best solutions below

0
joost On BEST ANSWER

Just guessing, something like this works (see blog post):

var connectAssets = require("connect-assets")();
app.use(connectAssets);
var hbs = require('hbs');
hbs.registerHelper('css', function() {
  var css = connectAssets.options.helperContext.css.apply(this, arguments);
  return new hbs.SafeString(css);
});