fix: hot reload (#45871)

This commit is contained in:
Oliver Eyton-Williams
2022-05-06 13:44:14 +02:00
committed by GitHub
parent 5908f2c74c
commit 08b60ffb25

View File

@@ -21,7 +21,7 @@ exports.replaceChallengeNode = () => {
const blockNameRe = /\d\d-[-\w]+\/([^/]+)\//;
const posix = path.normalize(filePath).split(path.sep).join(path.posix.sep);
const blockName = posix.match(blockNameRe)[1];
const metaPath = path.resolve(META_DIR, `/${blockName}/meta.json`);
const metaPath = path.resolve(META_DIR, `${blockName}/meta.json`);
delete require.cache[require.resolve(metaPath)];
const meta = require(metaPath);
// TODO: reimplement hot-reloading of certifications