-
Notifications
You must be signed in to change notification settings - Fork 34
/
gatsby-config.js
151 lines (147 loc) · 4.18 KB
/
gatsby-config.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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
const activeEnv =
process.env.ACTIVE_ENV || process.env.NODE_ENV || 'development'
const envConfig = {
path: `${__dirname}/.env`,
}
const env = require('dotenv').config(envConfig)
console.log('------- CURRENT ENVIRONMENT:', activeEnv.toUpperCase(), '-------')
if (env.errors) {
// handle errors
} else {
module.exports = {
siteMetadata: {
title: 'MetaMask',
description: `MetaMask is a Consensys Formation.`,
siteUrl:
activeEnv === 'development'
? 'https://metamask.consensys.io'
: 'https://metamask.io',
},
plugins: [
{
resolve: 'gatsby-plugin-google-tagmanager',
options: {
id: process.env.GATSBY_GTM_ID,
// Defaults to false meaning GTM will only be loaded in production.
includeInDevelopment: false,
// Defaults to false
enableWebVitalsTracking: true,
},
},
`gatsby-plugin-sass`,
'gatsby-plugin-react-helmet',
'gatsby-plugin-styled-components',
'gatsby-transformer-sharp',
'gatsby-transformer-remark',
'gatsby-plugin-root-import',
{
resolve: `gatsby-source-contentful`,
options: {
spaceId: process.env.GATSBY_CONTENTFUL_SPACE_ID,
accessToken: process.env.GATSBY_CONTENTFUL_API_KEY,
environment: process.env.GATSBY_CONTENTFUL_ENVIRONMENT,
downloadLocal: process.env.GATSBY_CONTENTFUL_DOWNLOAD_LOCAL,
host: process.env.GATSBY_CONTENTFUL_HOST,
},
},
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `MetaMask.io`,
short_name: `MM`,
description: `A crypto wallet & gateway to blockchain apps`,
start_url: `/`,
background_color: `#FFFFFF`,
theme_color: `#FFFFFF`,
display: `standalone`,
icon: `${__dirname}/src/images/metamask-logo.png`,
icons: [
{
src: `${__dirname}/favicon/android-chrome-192x192.png`,
sizes: '192x192',
type: 'image/png',
purpose: 'any maskable',
},
{
src: `${__dirname}/favicon/android-chrome-256x256.png`,
sizes: '256x256',
type: 'image/png',
},
{
src: `${__dirname}/favicon/android-chrome-384x384.png`,
sizes: '384x384',
type: 'image/png',
},
{
src: `${__dirname}/favicon/icon-512x512.png`,
sizes: '512x512',
type: 'image/png',
},
],
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: `${__dirname}/src/images`,
},
},
'gatsby-plugin-mdx',
{
resolve: `gatsby-source-filesystem`,
options: {
name: `legal`,
path: `${__dirname}/legal`,
},
__key: 'legal',
},
{
resolve: 'gatsby-plugin-react-svg',
options: {
rule: {
include: `${__dirname}/src/images`,
},
},
},
'gatsby-plugin-well-known',
'gatsby-plugin-image',
{
resolve: `gatsby-plugin-sharp`,
options: {
defaults: {
placeholder: `none`,
},
},
},
{
resolve: 'gatsby-plugin-robots-txt',
options:
activeEnv === 'production'
? {
host: 'https://metamask.io',
sitemap: 'https://metamask.io/sitemap-index.xml',
policy: [{ userAgent: '*', allow: '/' }],
}
: {
host: 'https://metamask.consensys.io',
sitemap: 'https://metamask.consensys.io/sitemap-index.xml',
policy: [{ userAgent: '*', disallow: '/' }],
},
},
{
resolve: 'gatsby-plugin-launchdarkly',
options: {
clientSideID: process.env.GATSBY_LD_CLIENT_ID,
context: {
anonymous: true,
kind: 'user',
},
options: {
allAttributesPrivate: true,
},
},
},
],
}
}