-
Notifications
You must be signed in to change notification settings - Fork 7
/
gatsby-config.ts
111 lines (107 loc) · 2.95 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
/* eslint-disable no-restricted-globals */
import type { GatsbyConfig } from 'gatsby';
const IS_STAGING = process.env.GATSBY_STAGING === 'true';
const STAGING_PATH_PREFIX = IS_STAGING
? `/${process.env.STAGING_PATH_PREFIX}`
: '';
const SITE_URL = IS_STAGING
? `https://metamask.github.io`
: 'https://snaps.metamask.io';
const config: GatsbyConfig = {
siteMetadata: {
title: 'MetaMask Snaps Directory',
siteUrl: SITE_URL,
author: 'MetaMask',
},
graphqlTypegen: true,
jsxRuntime: 'automatic',
pathPrefix: STAGING_PATH_PREFIX,
plugins: [
'gatsby-plugin-sharp',
'gatsby-transformer-sharp',
'gatsby-plugin-image',
'gatsby-plugin-sitemap',
'gatsby-plugin-react-helmet-async',
{
resolve: 'gatsby-source-filesystem',
options: { name: 'content', path: './src/pages' },
},
{
resolve: 'gatsby-plugin-manifest',
options: {
/* eslint-disable @typescript-eslint/naming-convention */
name: 'MetaMask Snaps Directory',
start_url: '/',
display: 'standalone',
icon: 'src/assets/favicon.svg',
background_color: '#ffffff',
theme_color: '#ffffff',
/* eslint-enable @typescript-eslint/naming-convention */
},
},
{
resolve: '@chakra-ui/gatsby-plugin',
options: {
/**
* @property {boolean} [resetCSS=true]
* if false, this plugin will not use `<CSSReset />
*/
resetCSS: true,
/**
* @property {number} [portalZIndex=undefined]
* The z-index to apply to all portal nodes. This is useful
* if your app uses a lot z-index to position elements.
*/
portalZIndex: undefined,
},
},
{
resolve: 'gatsby-plugin-fusejs',
options: {
query: `
{
allSnap {
nodes {
snapId
name
summary
description {
description
}
}
}
}
`,
keys: ['snapId', 'name', 'summary', 'description'],
normalizer: ({ data }) =>
data.allSnap.nodes.map((node) => ({
snapId: node.snapId,
name: node.name,
summary: node.summary,
description: node.description.description,
})),
},
},
{
resolve: 'gatsby-plugin-robots-txt',
options: {
host: 'https://snaps.metamask.io',
sitemap: 'https://snaps.metamask.io/sitemap-index.xml',
policy: [{ userAgent: '*', allow: '/' }],
},
},
...(process.env.SEGMENT_PRODUCTION_WRITE_KEY ||
process.env.SEGMENT_DEV_WRITE_KEY
? [
{
resolve: 'gatsby-plugin-segment-js',
options: {
prodKey: process.env.SEGMENT_PRODUCTION_WRITE_KEY,
devKey: process.env.SEGMENT_DEV_WRITE_KEY,
},
},
]
: []),
],
};
export default config;