mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 01:56:12 +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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user