-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgatsby-config.js
76 lines (69 loc) · 1.76 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
const express = require('express');
const activeEnv = process.env.GATSBY_ACTIVE_ENV || process.env.NODE_ENV || 'development';
require('dotenv').config({
path: `.env.${activeEnv}`,
});
const SITEURL = process.env.SITE_URL;
// Gatsby plugins list.
const plugins = [
'gatsby-plugin-root-import',
'@bodiless/gatsby-theme-bodiless',
{
resolve: 'gatsby-plugin-compile-es6-packages',
options: {
modules: ['@bodiless/gatsby-theme-bodiless'],
},
},
{
resolve: 'gatsby-plugin-manifest',
options: {
icon: 'src/images/favicon.png',
},
},
{
resolve: 'gatsby-plugin-canonical-urls',
options: {
siteUrl: SITEURL,
},
},
{
resolve: `gatsby-plugin-google-gtag`,
options: {
// You can add multiple tracking ids and a pageview event will be fired for all of them.
trackingIds: [
"G-0VTLWPRG9S",
],
},
},
{
resolve: 'gatsby-plugin-sitemap',
},
];
const tagManagerEnabled = (process.env.GOOGLE_TAGMANAGER_ENABLED || '1') === '1';
if (tagManagerEnabled) {
/**
* Google Tag Manager plugin.
*/
plugins.push({
resolve: 'gatsby-plugin-google-tagmanager',
options: {
id: process.env.GOOGLE_TAGMANAGER_ID || 'GTM-XXXXXXX',
// datalayer to be set before GTM is loaded
// should be an object or a function that is executed in the browser
// Defaults to null
// Specify optional GTM environment details.
// gtmAuth: 'YOUR_GOOGLE_TAGMANAGER_ENVIRONMENT_AUTH_STRING',
// gtmPreview: 'YOUR_GOOGLE_TAGMANAGER_ENVIRONMENT_PREVIEW_NAME',
dataLayerName: 'globalDataLayer',
},
});
}
module.exports = {
developMiddleware: app => {
app.use('/___docs', express.static('doc'));
},
siteMetadata: {
siteUrl: SITEURL,
},
plugins,
};