Something like this should work: in your config/views.js
engine: {
ext: 'swig', // Or `html`, whatever you are using
fn: function (pathName, locals, cb) {
var swig = require('swig');
swig.setDefaults({tagControls: ['{?', '?}']});
return swig.renderFile(pathName, locals, cb);
}
},
As for the config/swig.js
and module.exports.swig
, I don't think it's being processed automatically.