mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix: rebuild challenge pages if source is updated (#62056)
This commit is contained in:
committed by
GitHub
parent
49c64a14b3
commit
e257c2969e
@@ -39,13 +39,15 @@ exports.sourceNodes = function sourceChallengesSourceNodes(
|
||||
watcher.on('change', filePath =>
|
||||
/\.md?$/.test(filePath)
|
||||
? onSourceChange(filePath)
|
||||
.then(challenge => {
|
||||
.then(challenges => {
|
||||
reporter.info(
|
||||
`
|
||||
File changed at ${filePath}, replacing challengeNode id ${challenge.id}
|
||||
File changed at ${filePath}, replacing challengeNodes with ids ${challenges.map(({ id }) => id).join(', ')}
|
||||
`
|
||||
);
|
||||
createVisibleChallenge(challenge, { isReloading: true });
|
||||
challenges.forEach(challenge =>
|
||||
createVisibleChallenge(challenge, { isReloading: true })
|
||||
);
|
||||
})
|
||||
.catch(e =>
|
||||
reporter.error(`fcc-replace-challenge
|
||||
@@ -74,13 +76,15 @@ File changed at ${filePath}, replacing challengeNode id ${challenge.id}
|
||||
const { path: siblingPath } = entry;
|
||||
const relativePath = path.join(blockPath, siblingPath);
|
||||
onSourceChange(relativePath)
|
||||
.then(challenge => {
|
||||
.then(challenges => {
|
||||
reporter.info(
|
||||
`
|
||||
File changed at ${relativePath}, replacing challengeNode id ${challenge.id}
|
||||
File changed at ${relativePath}, replacing challengeNodes with ids ${challenges.map(({ id }) => id).join(', ')}
|
||||
`
|
||||
);
|
||||
createVisibleChallenge(challenge);
|
||||
challenges.forEach(challenge =>
|
||||
createVisibleChallenge(challenge)
|
||||
);
|
||||
})
|
||||
.catch(e =>
|
||||
reporter.error(`fcc-replace-challenge
|
||||
|
||||
Reference in New Issue
Block a user