From dd050c81774f7ea17fdc7057f3ad74054e12212f Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 18 Feb 2016 20:42:59 -0500 Subject: [PATCH] added new hook that is called before templates are compiled --- src/meta/templates.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/meta/templates.js b/src/meta/templates.js index 9a5aa5c72b..8df981c572 100644 --- a/src/meta/templates.js +++ b/src/meta/templates.js @@ -42,10 +42,14 @@ Templates.compile = function(callback) { } } - plugins.getTemplates(function(err, pluginTemplates) { + async.waterfall([ + async.apply(plugins.fireHook, 'static:templates.precompile', {}), + async.apply(plugins.getTemplates) + ], function(err, pluginTemplates) { if (err) { return callback(err); } + winston.verbose('[meta/templates] Compiling templates'); rimraf.sync(viewsPath); mkdirp.sync(viewsPath);