forked from andresgalante/patternfly-next
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgatsby-node.js
More file actions
60 lines (58 loc) · 1.32 KB
/
gatsby-node.js
File metadata and controls
60 lines (58 loc) · 1.32 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
const path = require('path');
// Don't include CSS from JS
exports.onCreateWebpackConfig = ({ actions }) => {
actions.setWebpackConfig({
module: {
rules: [
{
test: /\.css$/,
include: [
path.resolve(__dirname, 'node_modules/@patternfly/patternfly'),
path.resolve(__dirname, 'node_modules/@patternfly/react-styles/css')
],
loader: 'null-loader'
}
]
}
});
};
exports.createSchemaCustomization = ({ actions }) => {
const typeDefs = `
type MdxFrontmatter @infer {
title: String!
section: String
cssPrefix: String
hideTOC: Boolean
optIn: String
experimentalStage: String
propComponents: [String]
hideDarkMode: Boolean
}
type Mdx implements Node @infer {
frontmatter: MdxFrontmatter
}
type TypeType @infer {
name: String!
}
type TsType @infer {
name: String!
raw: String
}
type defaultValue @infer {
value: String!
}
type PropsType @infer {
name: String
description: String
required: Boolean
type: TypeType
tsType: TsType
defaultValue: defaultValue
}
type ComponentMetadata implements Node @infer {
name: String!
props: PropsType
}
`;
actions.createTypes(typeDefs);
}