From 7d8e3d78a1c2653ac47b9642f71d8d1410f12546 Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Thu, 25 Apr 2024 20:18:31 +0200 Subject: [PATCH] fix(client): hot-reloading challenges (#54515) --- client/utils/build-challenges.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/client/utils/build-challenges.js b/client/utils/build-challenges.js index df5c5c4d762..44f122f4c34 100644 --- a/client/utils/build-challenges.js +++ b/client/utils/build-challenges.js @@ -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);