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

@@ -72,15 +72,17 @@ describe('Controllers', function () {
});
}
var message = utils.generateUUID();
var tplPath = path.join(nconf.get('views_dir'), 'custom.tpl');
var name = 'custom.tpl';
var tplPath = path.join(nconf.get('views_dir'), name);
before(function () {
before(function (done) {
plugins.registerHook('myTestPlugin', {
hook: 'action:homepage.get:custom',
method: hookMethod,
});
fs.writeFileSync(tplPath, message);
meta.templates.compileTemplate(name, message, done);
});
it('should load default', function (done) {