0

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.

Michael Joseph Aubry
  • 12,282
  • 16
  • 70
  • 135

1 Answers1

2

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);
});
joost
  • 6,549
  • 2
  • 31
  • 36