-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-config.js
53 lines (51 loc) · 1.5 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
// support for .env, .env.development, and .env.production
require("dotenv").config()
require("dotenv").config({
path: `.env.${process.env.NODE_ENV}`,
})
console.log("baseUrl: ", process.env.DRUPAL_BASE_URL)
console.log("basic auth User: ", process.env.DRUPAL_BASIC_AUTH_USERNAME)
module.exports = {
siteMetadata: {
title: `Gatsby with Drupal Sector Example`,
},
plugins: [
{
resolve: `gatsby-source-drupal`,
options: {
typePrefix: "Drupal",
apiBase: `jsonapi`,
baseUrl: process.env.DRUPAL_BASE_URL,
concurrentFileRequests: 10,
fastBuilds: true,
basicAuth: {
username: process.env.DRUPAL_BASIC_AUTH_USERNAME,
password: process.env.DRUPAL_BASIC_AUTH_PASSWORD,
},
headers: {
"api-key": process.env.APIKEY,
},
},
},
`gatsby-plugin-offline`,
`gatsby-plugin-image`,
`gatsby-plugin-sharp`,
`gatsby-transformer-sharp`, // Needed for dynamic images
{
resolve: `gatsby-plugin-schema-snapshot`,
options: {
path: `schema.gql`,
update: process.env.GATSBY_UPDATE_SCHEMA_SNAPSHOT,
},
},
// {
// resolve: `gatsby-source-drupal-menu-links`,
// options: {
// typePrefix: "Drupal",
// baseUrl: process.env.DRUPAL_BASE_URL,
// apiBase: `jsonapi`, // optional, defaults to `jsonapi`
// menus: ["main", "main-menu", "account"], // Which menus to fetch, there are the menu IDs.
// },
// },
],
}