-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-config.js
161 lines (146 loc) · 4.39 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
152
153
154
155
156
157
158
159
160
161
/*
* Configure your Gatsby site with this file.
* https://www.gatsbyjs.org/docs/gatsby-config/
*/
const path = require("path");
require('dotenv').config({
path: `.env${ (process.env.NODE_ENV === 'development' ) ? '.development' : (process.env.NODE_ENV) ? '.'+process.env.NODE_ENV : ''}`
})
module.exports = {
flags: {
FAST_DEV: true,
PRESERVE_FILE_DOWNLOAD_CACHE: process.env.PRESERVE_FILE_DOWNLOAD_CACHE || false,
PARALLEL_SOURCING: true,
// LMDB_STORE: true,
},
pathPrefix: process.env.PATH_PREFIX === "" ? "/" : process.env.PATH_PREFIX,
siteMetadata: {
siteUrl: process.env.SITE_URL,
title: process.env.SITE_TITLE,
titleTemplate: "%s"+' '+process.env.SITE_SEPARATOR+' '+process.env.SITE_TITLE,
description: process.env.SITE_DESCRIPTION,
url: process.env.SITE_URL,
image: process.env.SITE_IMAGE,
},
/* Your site config here */
plugins: [
/*
* Functions
*/
"gatsby-plugin-react-helmet",
{
resolve: `gatsby-plugin-sass`
},
{
resolve: `gatsby-plugin-layout`,
options: {
component: `${__dirname}/src/components/layouts/index.js`
}
},
/*
* Sources & Assets
*/
{
resolve: `gatsby-source-wordpress`,
options: {
url: process.env.WPGRAPHQL_URL,
verbose: true,
schema: {
perPage: process.env.SCHEMA_PER_PAGE || 50,
requestConcurrency: process.env.SCHEMA_REQUEST_CONCURRENCY || 50,
previewRequestConcurrency: process.env.SCHEMA_PREVIEW_REQUEST_CONCURRENCY || 2,
timeout: process.env.SCHEMA_TIMEOUT || 120000,
},
debug: {
graphql: {
writeQueriesToDisk: false,
showQueryVarsOnError: false,
},
},
type: {
__all: {
limit: process.env.LIMIT_ALL || null,
},
},
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: path.join(__dirname, `src`, `assets`),
},
},
/*
* Analytics
*/
{
resolve: `gatsby-plugin-gdpr-cookies`,
options: {
googleAnalytics: {
trackingId: process.env.GOOGLE_TRACKING_ID || '',
anonymize: true
},
facebookPixel: {
pixelId: process.env.FACEBOOK_PIXEL || '',
},
environments: ['production', 'development']
},
},
/*
* Image Processing
*/
`gatsby-plugin-image`,
`gatsby-transformer-sharp`,
{
resolve: `gatsby-plugin-sharp`,
options: {
defaults: {},// Defaults used for gatsbyImageData and StaticImage
failOnError: false, // Set to false to allow builds to continue on image errors
stripMetadata: true,
defaultQuality: 50,
// useMozJpeg: process.env.GATSBY_JPEG_ENCODER === `MOZJPEG`,
},
},
/*
* SEO related
*/
{
resolve: `gatsby-plugin-canonical-urls`,
options: {
siteUrl: process.env.GATSBY_SITE_CANONICAL_URL,
stripQueryString: true,
},
},
{
resolve: 'gatsby-plugin-robots-txt',
options: {
host: process.env.SITE_URL,
policy: [
{ userAgent: '*', allow: '/' }
]
}
},
`gatsby-plugin-sitemap`,
/*
* Algolia
* This plugin must be placed last in your list of plugins to ensure that it can query all the GraphQL data
*/
{
resolve: `gatsby-plugin-algolia`,
options: {
appId: process.env.GATSBY_ALGOLIA_APP_ID,
apiKey: process.env.ALGOLIA_ADMIN_KEY,
queries: require("./src/utils/algolia-queries"),
matchFields: ['slug', 'modified', 'campus'],
enablePartialUpdates: process.env.ALGOLIA_PARTIAL_UPDATES || true,
chunkSize: 10000,
},
},
/*
* Redirect
* Must be the last in the array
*/
`gatsby-plugin-meta-redirect`,
],
}