-
Notifications
You must be signed in to change notification settings - Fork 87
/
gatsby-config.ts
130 lines (127 loc) · 3.51 KB
/
gatsby-config.ts
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
import type { GatsbyConfig } from 'gatsby';
const config: GatsbyConfig = {
siteMetadata: {
title: `cms-design-system-docs`,
siteUrl: `https://www.design.cms.gov`,
},
plugins: [
'gatsby-plugin-sass',
'gatsby-plugin-react-helmet',
'gatsby-plugin-sitemap',
{
resolve: 'gatsby-source-filesystem',
// content to display on site
options: {
name: 'content',
path: './content/',
},
},
{
resolve: 'gatsby-source-filesystem',
// components to load prop data from
options: {
name: 'components',
path: '../design-system/src/components',
},
},
{
resolve: 'gatsby-source-filesystem',
// components to load prop data from
options: {
name: 'hgov-components',
path: '../ds-healthcare-gov/src/components',
},
},
{
resolve: 'gatsby-source-filesystem',
// components to load prop data from
options: {
name: 'mgov-components',
path: '../ds-medicare-gov/src/components',
},
},
{
resolve: 'gatsby-plugin-manifest',
options: {
name: 'CMS Design System',
short_name: 'CMS DS',
start_url: '/',
background_color: '#0071bc',
theme_color: '#0071bc',
// Enables "Add to Homescreen" prompt and disables browser UI (including back button)
// see https://developers.google.com/web/fundamentals/web-app-manifest/#display
display: 'standalone',
icon: 'src/images/favicon.ico', // This path is relative to the root of the site.
// An optional attribute which provides support for CORS check.
// If you do not provide a crossOrigin option, it will skip CORS for manifest.
// Any invalid keyword or empty string defaults to `anonymous`
crossOrigin: `use-credentials`,
},
},
{
resolve: 'gatsby-plugin-mdx',
options: {
gatsbyRemarkPlugins: ['gatsby-remark-autolink-headers'],
},
},
{
resolve: 'gatsby-plugin-newrelic',
options: {
config: {
instrumentationType: 'proAndSPA',
accountId: '402306',
trustKey: '39033',
agentID: '1134210514',
licenseKey: '5a79be86db',
applicationID: '1134210514',
beacon: 'gov-bam.nr-data.net',
errorBeacon: 'gov-bam.nr-data.net',
},
},
},
{
resolve: 'gatsby-plugin-local-search',
options: {
name: 'pages',
engine: 'flexsearch',
engineOptions: {
tokenize: 'full',
encoder: 'simple',
},
query: `
{
allMdx (
filter: {fileAbsolutePath: {glob: "**/content/**/*"}}
) {
edges {
node {
id
slug
frontmatter {
title
}
rawBody
}
}
}
}
`,
ref: 'id',
index: ['title', 'body'],
store: ['path', 'title', 'body'],
normalizer: ({ data }) =>
data.allMdx.edges.map((n) => ({
id: n.node.id,
path: n.node.slug,
title: n.node.frontmatter.title,
body: n.node.rawBody.replace(/(<([^>]+)>)/gi, '').replace(/\\n/gi, ''),
})),
},
},
'gatsby-plugin-client-side-redirect',
],
};
if (process.env.PATH_PREFIX) {
config.pathPrefix = process.env.PATH_PREFIX;
}
export default config;