forked from paritytech/substrate-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-node.js
26 lines (21 loc) · 833 Bytes
/
gatsby-node.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const { createProjectPages } = require('./gatsby-node/create-pages.js');
exports.createPages = async props => {
await Promise.all([createProjectPages(props)]);
};
const { addLangFieldToMarkdown, addSlugFieldToMarkdown } = require('./gatsby-node/on-create-node.js');
exports.onCreateNode = props => {
const { node } = props;
if (node.internal.type === `MarkdownRemark`) {
addLangFieldToMarkdown(props);
addSlugFieldToMarkdown(props);
}
};
const { modifyWebpackConfig } = require('./gatsby-node/on-create-webpack-config.js');
// TODO: temporary workaround for https://github.com/gatsbyjs/gatsby/issues/31878
exports.onCreateWebpackConfig = props => {
const { stage } = props;
// override config only during production JS & CSS build
if (stage === 'build-javascript') {
modifyWebpackConfig(props);
}
};