From 9b6b00b34f983a91226ac16ba08e44066dfd171f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20Bou=C3=A7as?= Date: Tue, 19 Dec 2017 11:25:33 +0000 Subject: [PATCH] fix: write compiled templates to client-side --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 2611f62..0caf79d 100644 --- a/index.js +++ b/index.js @@ -72,6 +72,7 @@ module.exports = () => { debug('Starting Dust.js engine...') this.additionalTemplates = options.additionalTemplates + this.compiledTemplates = {} this.config = options.config this.pagesPath = options.pagesPath this.templates = options.templates @@ -193,6 +194,8 @@ module.exports = () => { const compiledData = dust.compile(data, name) + this.compiledTemplates[name] = compiledData + dust.loadSource(compiledData) return true @@ -260,7 +263,7 @@ module.exports = () => { let templatesOutput = '' templates.forEach(name => { - templatesOutput += dust.cache[name] + templatesOutput += this.compiledTemplates[name] }) queue.push(