1

I have been trying to find information on how to configure Sails to use the Vash view engine. I am not sure if it is possible or not, as it seems view engines that are compatible with Sails must be based on consolidate.js. I'm not sure if Vash is based on consolidate, and have been unable to figure out if it is or not.

jrista
  • 32,447
  • 15
  • 90
  • 130

1 Answers1

1

According to documentation, you should pass to configs template extension and function for render. I've tried with express function and seems it is working for me, here what I have in config/views.js:

engine: {
    ext: 'vsh',
    fn: require('vash').__express
}
monkeyinsight
  • 4,719
  • 1
  • 20
  • 28
  • I used `ext: 'vash'` since that seems to be the proper extension, but otherwise, this works for me. There's a [pull request](https://github.com/tj/consolidate.js/pull/200) to bring Vash into Consolidate.js, but until that happens, this is the cleanest solution. – Gallant Dec 08 '15 at 15:49