-
Notifications
You must be signed in to change notification settings - Fork 1
/
gatsby-node.ts
48 lines (42 loc) · 1.25 KB
/
gatsby-node.ts
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
import type { CreateSchemaCustomizationArgs, CreateWebpackConfigArgs, GatsbyNode } from 'gatsby'
import path from 'path'
export const onCreateWebpackConfig: GatsbyNode['onCreateWebpackConfig'] = ({ actions }: CreateWebpackConfigArgs) => {
actions.setWebpackConfig({
resolve: {
alias: {
'@/styles': path.resolve(__dirname, 'src/styles'),
'@/images': path.resolve(__dirname, 'src/images'),
'@/components': path.resolve(__dirname, 'src/components'),
'@/constants': path.resolve(__dirname, 'src/constants'),
'@/layouts': path.resolve(__dirname, 'src/layouts'),
'@/utils': path.resolve(__dirname, 'src/utils'),
},
},
})
}
export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] = ({
actions,
}: CreateSchemaCustomizationArgs) => {
const { createTypes } = actions
createTypes(`
type SiteSiteMetadata {
title: String!
siteUrl: String!
description: String!
OGImage: String!
}
type Site implements Node {
siteMetadata: SiteSiteMetadata!
}
type Link {
android: String!
ios: String!
}
type AppJson implements Node {
link: Link!
year: String!
description: String!
name: String!
}
`)
}