mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
refactor: skip curriculum import to save compile time (#64742)
This commit is contained in:
committed by
GitHub
parent
0a62067256
commit
9b15ce53af
@@ -1,4 +1,13 @@
|
||||
import curriculum from '../../../shared-dist/config/curriculum.json';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
|
||||
const CURRICULUM_PATH = '../../../shared-dist/config/curriculum.json';
|
||||
// const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
// Curriculum is read using fs, because it is too large for VSCode's LSP to handle type inference which causes annoying behavior.
|
||||
const curriculum = JSON.parse(
|
||||
readFileSync(join(__dirname, CURRICULUM_PATH), 'utf-8')
|
||||
);
|
||||
|
||||
import {
|
||||
buildExtCurriculumDataV1,
|
||||
Curriculum as CurriculumV1,
|
||||
@@ -20,10 +29,6 @@ if (isSelectiveBuild) {
|
||||
'Skipping external curriculum build (selective build mode active)'
|
||||
);
|
||||
} else {
|
||||
buildExtCurriculumDataV1(
|
||||
curriculum as unknown as CurriculumV1<CurriculumPropsV1>
|
||||
);
|
||||
buildExtCurriculumDataV2(
|
||||
curriculum as unknown as CurriculumV2<CurriculumPropsV2>
|
||||
);
|
||||
buildExtCurriculumDataV1(curriculum as CurriculumV1<CurriculumPropsV1>);
|
||||
buildExtCurriculumDataV2(curriculum as CurriculumV2<CurriculumPropsV2>);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user