-
Notifications
You must be signed in to change notification settings - Fork 17
/
gatsby-config.ts
112 lines (106 loc) · 3.21 KB
/
gatsby-config.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import path from 'path'
import dotenv from 'dotenv'
import emoji from 'remark-emoji'
import { algoliaConfig } from './gatsby-plugin-algolia-config'
import { AIRTABLE_MOCK_DATA } from './src/constants/airtable'
import type { GatsbyConfig } from 'gatsby'
dotenv.config({
path: '.env',
})
const config: GatsbyConfig = {
siteMetadata: {
title: 'SmartHR Design System',
description: 'SmartHR Design Systemは、だれでも・効率よく・迷わずにSmartHRらしい表現をするためのデザインシステムです。',
siteUrl: 'https://smarthr.design',
author: '@SHRDesignSystem',
ogimage: '/images/ogp.png',
},
graphqlTypegen: true,
plugins: [
{
resolve: 'gatsby-plugin-google-gtag',
options: {
trackingIds: ['G-HNCBKCD85V'],
pluginConfig: {
head: true,
respectDNT: true,
},
},
},
...(process.env.IS_TYPE_GEN ? ['gatsby-plugin-typegen'] : []),
'gatsby-plugin-styled-components',
'gatsby-plugin-sharp',
{
resolve: 'gatsby-plugin-algolia',
options: algoliaConfig,
},
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'articles',
path: path.resolve(`content/articles`),
},
},
{
resolve: 'gatsby-plugin-mdx',
options: {
extensions: ['.mdx'],
defaultLayouts: {
defaults: path.resolve('src/templates/article.tsx'),
},
gatsbyRemarkPlugins: [
{ resolve: path.resolve(`src/plugins/gatsby-remark-index-id-header/index.js`) },
{
resolve: 'gatsby-remark-images',
options: {
quality: 90,
maxWidth: 1024,
disableBgImageOnAlpha: true,
disableBgImage: false,
},
},
{
resolve: `gatsby-remark-image-attributes`,
options: {
dataAttributes: true,
},
},
'gatsby-remark-gifs',
],
remarkPlugins: [emoji],
},
},
// AIRTABLEキーが設定されているか、本番環境の場合はgatsby-source-airtable、それ以外ではモックデータを利用する
...((process.env.AIRTABLE_PERSONAL_ACCESS_TOKEN && process.env.AIRTABLE_BASE_ID) || process.env.BRANCH === 'main'
? [
{
resolve: `gatsby-source-sds-airtable`,
options: {
personalAccessToken: process.env.AIRTABLE_PERSONAL_ACCESS_TOKEN,
baseId: process.env.AIRTABLE_BASE_ID,
tableView: 'design system表示用',
},
},
]
: [
{
resolve: `gatsby-source-mock`,
options: {
schema: AIRTABLE_MOCK_DATA,
count: AIRTABLE_MOCK_DATA.length,
type: 'SdsAirtable',
},
},
]),
{
resolve: `gatsby-source-ui-versions`,
options: {
uiRepoApi: 'https://api.github.com/repos/kufu/smarthr-ui',
releaseBotEmail: '41898282+github-actions[bot]@users.noreply.github.com',
chromaticDomain: '63d0ccabb5d2dd29825524ab.chromatic.com',
},
},
{ resolve: `gatsby-source-component-captures` },
],
}
export default config