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:
Peter Jaszkowiak
2018-07-15 00:12:37 -06:00
parent 9d005fa203
commit 04d31fe1d4
7 changed files with 65 additions and 82 deletions

View File

@@ -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);