From 19c11312c553a12137f26b3472e885edc2c4c75d Mon Sep 17 00:00:00 2001 From: Xymorot Date: Sat, 8 Feb 2020 22:27:43 +0100 Subject: [PATCH] config: fix building of index.html in watch mode (do not cache data.json) --- templates/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/index.js b/templates/index.js index 93b7f89..e757859 100644 --- a/templates/index.js +++ b/templates/index.js @@ -1,10 +1,11 @@ const handlebars = require('handlebars'); const path = require('path'); const fs = require('fs'); -const data = require('./data'); const packageJson = require('../package'); function compile(isDevMode = false) { + const dataPath = path.resolve(__dirname, 'data.json'); + const data = JSON.parse(fs.readFileSync(dataPath).toString()); const templatePath = path.resolve(__dirname, 'index.html.handlebars'); const template = fs.readFileSync(templatePath).toString(); const delegate = handlebars.compile(template);