mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
30bcf40381
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
108 lines
2.7 KiB
JavaScript
108 lines
2.7 KiB
JavaScript
const path = require('path');
|
|
const envData = require('./config/env.json');
|
|
const {
|
|
buildChallenges,
|
|
replaceChallengeNodes,
|
|
localeChallengesRootDir
|
|
} = require('./utils/build-challenges');
|
|
const { pathPrefix } = require('./utils/gatsby/path-prefix');
|
|
|
|
const { curriculumLocale, homeLocation } = envData;
|
|
|
|
const curriculumIntroRoot = path.resolve(__dirname, './src/pages');
|
|
|
|
module.exports = {
|
|
flags: {
|
|
DEV_SSR: false
|
|
},
|
|
trailingSlash: 'ignore',
|
|
siteMetadata: {
|
|
title: 'freeCodeCamp',
|
|
siteUrl: homeLocation
|
|
},
|
|
pathPrefix: pathPrefix,
|
|
plugins: [
|
|
'gatsby-plugin-pnpm-gatsby-5',
|
|
{
|
|
resolve: 'gatsby-plugin-webpack-bundle-analyser-v2',
|
|
options: {
|
|
analyzerMode: 'disabled',
|
|
// It doesn't matter if the file is generated or not as far as caching
|
|
// is concerned. It doesn't affect any tasks in any way, so we can
|
|
// ignore it.
|
|
|
|
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
|
generateStatsFile: process.env.CI
|
|
}
|
|
},
|
|
'gatsby-plugin-react-helmet',
|
|
{
|
|
resolve: 'gatsby-plugin-postcss',
|
|
options: {
|
|
postcssOptions: {
|
|
config: path.resolve(__dirname, 'postcss.config.js')
|
|
}
|
|
}
|
|
},
|
|
{
|
|
resolve: require.resolve(
|
|
'../tools/client-plugins/gatsby-source-challenges'
|
|
),
|
|
options: {
|
|
name: 'challenges',
|
|
source: buildChallenges,
|
|
onSourceChange: replaceChallengeNodes(curriculumLocale),
|
|
curriculumPath: localeChallengesRootDir
|
|
}
|
|
},
|
|
{
|
|
resolve: 'gatsby-source-filesystem',
|
|
options: {
|
|
name: 'introductions',
|
|
path: curriculumIntroRoot
|
|
}
|
|
},
|
|
{
|
|
resolve: 'gatsby-transformer-remark'
|
|
},
|
|
{
|
|
resolve: require.resolve(
|
|
'../tools/client-plugins/gatsby-remark-node-identity'
|
|
),
|
|
options: {
|
|
identity: 'blockIntroMarkdown',
|
|
predicate: ({ frontmatter }) => {
|
|
if (!frontmatter) {
|
|
return false;
|
|
}
|
|
const { title, block, superBlock } = frontmatter;
|
|
return title && block && superBlock;
|
|
}
|
|
}
|
|
},
|
|
{
|
|
resolve: require.resolve(
|
|
'../tools/client-plugins/gatsby-remark-node-identity'
|
|
),
|
|
options: {
|
|
identity: 'superBlockIntroMarkdown',
|
|
predicate: ({ frontmatter }) => {
|
|
if (!frontmatter) {
|
|
return false;
|
|
}
|
|
const { title, block, superBlock } = frontmatter;
|
|
return title && !block && superBlock;
|
|
}
|
|
}
|
|
},
|
|
'gatsby-plugin-remove-serviceworker',
|
|
{
|
|
resolve: 'gatsby-plugin-schema-snapshot',
|
|
options: {
|
|
path: 'schema.gql',
|
|
update: process.env.GATSBY_UPDATE_SCHEMA_SNAPSHOT === 'true'
|
|
}
|
|
}
|
|
]
|
|
};
|