mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
optimizing template compilation
This commit is contained in:
@@ -71,9 +71,17 @@ function compileTemplates(pluginTemplates) {
|
||||
rimraf.sync(viewsPath);
|
||||
mkdirp.sync(viewsPath);
|
||||
|
||||
utils.walk(baseTemplatesPath, function(err, baseTpls) {
|
||||
utils.walk(themeTemplatesPath, function (err, themeTpls) {
|
||||
var paths = {};
|
||||
async.parallel({
|
||||
baseTpls: function(next) {
|
||||
utils.walk(baseTemplatesPath, next);
|
||||
},
|
||||
themeTpls: function(next) {
|
||||
utils.walk(themeTemplatesPath, next);
|
||||
}
|
||||
}, function(err, data) {
|
||||
var baseTpls = data.baseTpls,
|
||||
themeTpls = data.themeTpls,
|
||||
paths = {};
|
||||
|
||||
if (!baseTpls || !themeTpls) {
|
||||
winston.warn('[themes] Could not find base template files at: ' + baseTemplatesPath);
|
||||
@@ -123,7 +131,6 @@ function compileTemplates(pluginTemplates) {
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function handleErrors(err, req, res, next) {
|
||||
|
||||
Reference in New Issue
Block a user