diff --git a/lib/compilers/pug.js b/lib/compilers/pug.js index 5740b0c..9fddcb1 100644 --- a/lib/compilers/pug.js +++ b/lib/compilers/pug.js @@ -3,8 +3,13 @@ var ensureRequire = require('../ensure-require.js') module.exports = function (raw, cb, compiler) { ensureRequire('pug', 'pug') var pug = require('pug') + var locals + var options = compiler.options.pug || {} + + locals = options.data || {} + try { - var html = pug.compile(raw, compiler.options.pug || {})() + var html = pug.compile(raw, options)(locals) } catch (err) { return cb(err) }