-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-config.js
78 lines (74 loc) · 1.98 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
const { resolve } = require("path");
const tsconfig = require("./support/typescript/tsconfig");
/**
* Use the paths property from the tsconfig.json file instead of having to keep
* duplicating aliases
*/
const formatPaths = ({ baseUrl, paths }) =>
Object.keys(paths).reduce(
(acc, key) => {
const value = paths[key][0].replace("/*", "");
const cleanKey = key.replace("/*", "");
return {
...acc,
[cleanKey]: resolve(baseUrl, value),
};
},
{ root: resolve(__dirname, baseUrl) },
);
/**
* Configure your Gatsby site with this file.
*
* See: https://www.gatsbyjs.org/docs/gatsby-config/
*/
module.exports = {
siteMetadata: {
title: "singularity-template",
description: "",
release: {
commit: process.env.COMMIT_SHA || "",
version: process.env.RELEASE_VERSION || "",
channel: process.env.DEPLOYMENT_CHANNEL || "",
},
},
plugins: [
{
resolve: "gatsby-plugin-root-import",
options: formatPaths(tsconfig.compilerOptions),
},
"gatsby-plugin-emotion",
"gatsby-plugin-lodash",
"gatsby-plugin-ts",
{
resolve: `gatsby-plugin-google-analytics`,
options: {
// replace "UA-XXXXXXXXX-X" with your own Tracking ID
trackingId:
process.env.GOOGLE_ANALYTICS_TRACKING_ID || "UA-XXXXXXXXX-X",
},
},
{
resolve: "gatsby-plugin-manifest",
options: {
/* eslint-disable @typescript-eslint/camelcase */
name: "singularity-template",
short_name: "singularity-template",
start_url: "/",
background_color: "#f7f0eb",
theme_color: "#a2466c",
display: "standalone",
},
},
{
resolve: "gatsby-source-graphql",
options: {
typeName: "RickAndMorty",
fieldName: "rickAndMorty",
url: "https://rickandmortyapi.com/graphql",
},
},
"gatsby-plugin-offline",
"gatsby-plugin-webpack-bundle-analyser-v2",
"gatsby-plugin-webpack-size",
],
};