Something like this should work: in config/views.js
engine: {
ext: 'swig',
fn: function (pathName, locals, cb) {
var swig = require('swig');
swig.setDefaults({tagControls: ['{?', '?}']});
return swig.renderFile(pathName, locals, cb);
}
},
As for config/swig.jsand module.exports.swig, I do not think that it is processed automatically.
source
share