fix(client): hot-reloading challenges (#54515)

This commit is contained in:
Oliver Eyton-Williams
2024-04-25 20:18:31 +02:00
committed by GitHub
parent 6ae5d0bf3b
commit 7d8e3d78a1
+7 -5
View File
@@ -24,16 +24,18 @@ exports.replaceChallengeNode = () => {
const metaPath = path.resolve(META_DIR, `${blockName}/meta.json`);
delete require.cache[require.resolve(metaPath)];
const meta = require(metaPath);
const englishPath = path.resolve(CHALLENGES_DIR, 'english', filePath);
const i18nPath = path.resolve(CHALLENGES_DIR, curriculumLocale, filePath);
// TODO: reimplement hot-reloading of certifications
const createChallenge = generateChallengeCreator(
curriculumLocale,
englishPath,
i18nPath
);
return await createChallenge(filePath, meta);
};
};
const createChallenge = generateChallengeCreator(
CHALLENGES_DIR,
curriculumLocale
);
exports.buildChallenges = async function buildChallenges() {
const curriculum = await getChallengesForLang(curriculumLocale);
const superBlocks = Object.keys(curriculum);