mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-05 05:25:49 +01:00
Precompile all templates
- Benchpress compilation is 33x faster now - Native module with JS fallback and pre-built binaries - Dev template build is <1sec now - Minified template build is ~5sec (uglify accounts for almost all)
This commit is contained in:
@@ -147,15 +147,7 @@ function setupExpressApp(app, callback) {
|
||||
app.engine('tpl', function (filepath, data, next) {
|
||||
filepath = filepath.replace(/\.tpl$/, '.js');
|
||||
|
||||
middleware.templatesOnDemand({
|
||||
filePath: filepath,
|
||||
}, null, function (err) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
Benchpress.__express(filepath, data, next);
|
||||
});
|
||||
Benchpress.__express(filepath, data, next);
|
||||
});
|
||||
app.set('view engine', 'tpl');
|
||||
app.set('views', viewsDir);
|
||||
|
||||
Reference in New Issue
Block a user