config: fix building of index.html in watch mode (do not cache data.json)

This commit is contained in:
Xymorot 2020-02-08 22:27:43 +01:00
parent 21ac8602ff
commit 19c11312c5
1 changed files with 2 additions and 1 deletions

View File

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