mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 18:16:17 +01:00
Merge remote-tracking branch 'origin/master' into develop
This commit is contained in:
@@ -237,12 +237,18 @@ middleware.templatesOnDemand = function (req, res, next) {
|
||||
fs.readFile(filePath.replace(/\.js$/, '.tpl'), 'utf8', cb);
|
||||
},
|
||||
function (source, cb) {
|
||||
if (!source) {
|
||||
return cb(new Error('[[error:templatesOnDemand.source-template-empty]]'));
|
||||
}
|
||||
Benchpress.precompile({
|
||||
source: source,
|
||||
minify: global.env !== 'development',
|
||||
}, cb);
|
||||
},
|
||||
function (compiled, cb) {
|
||||
if (!compiled) {
|
||||
return cb(new Error('[[error:templatesOnDemand.compiled-template-empty]]'));
|
||||
}
|
||||
fs.writeFile(filePath, compiled, cb);
|
||||
},
|
||||
], function (err) {
|
||||
|
||||
Reference in New Issue
Block a user