freeCodeCamp/client/gatsby-config.js
Oliver Eyton-Williams f5361f4341
Some checks failed
i18n - Build Validation / Validate i18n Builds (22) (push) Has been cancelled
CI - Node.js / Lint (22) (push) Has been cancelled
CI - Node.js / Build (22) (push) Has been cancelled
CI - Node.js / Test (22) (push) Has been cancelled
CI - Node.js / Test - Upcoming Changes (22) (push) Has been cancelled
CD - Docker - DOCR Cleanup Container Images / Delete Old Images (learn-api, dev) (push) Has been cancelled
CD - Docker - DOCR Cleanup Container Images / Delete Old Images (learn-api, org) (push) Has been cancelled
i18n - Download Client UI / Client (push) Has been cancelled
fix(client): apply i18n prefix to test-runner (#62523)
2025-10-10 11:18:27 +05:30

119 lines
2.8 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
},
siteMetadata: {
title: 'freeCodeCamp',
siteUrl: homeLocation
},
pathPrefix: pathPrefix,
plugins: [
'gatsby-plugin-pnpm',
{
resolve: 'gatsby-plugin-webpack-bundle-analyser-v2',
options: {
analyzerMode: 'disabled',
generateStatsFile: process.env.CI
}
},
'gatsby-plugin-react-helmet',
{
resolve: 'gatsby-plugin-postcss',
options: {
postcssOptions: {
config: path.resolve(__dirname, 'postcss.config.js')
}
}
},
{
resolve: 'gatsby-plugin-create-client-paths',
options: {
prefixes: [
'/certification/*',
'/unsubscribed/*',
'/user/*',
'/settings/*',
'/n/*'
]
}
},
{
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;
}
}
},
{
resolve: 'gatsby-plugin-manifest',
options: {
name: 'freeCodeCamp',
short_name: 'fCC',
start_url: '/',
theme_color: '#0a0a23',
background_color: '#fff',
display: 'minimal-ui',
icon: 'src/assets/images/square_puck.png'
}
},
'gatsby-plugin-remove-serviceworker'
]
};