-
Notifications
You must be signed in to change notification settings - Fork 1
/
gatsby-config.ts
92 lines (88 loc) · 3.01 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
import type { GatsbyConfig } from 'gatsby';
import path from 'path';
import enUSMessages from './lang/en-US.json';
import esMXMessages from './lang/es-MX.json';
require(`dotenv`).config({
// NODE_ENV is automatically set to
// 'development' when the app is launched via 'npm start' or 'npm develop'
// 'production' when the app is launched via 'npm build'
// Depending on the node environment, the app will then use
// .env.production or .env.development for application
// env variables.
path: `.env.${process.env.NODE_ENV}`,
});
const config: GatsbyConfig = {
flags: {
DEV_SSR: true,
},
pathPrefix: process.env.DEPLOY_PREFIX || ``,
// Since `gatsby-plugin-typescript` is automatically included in Gatsby you
// don't need to define it here (just if you need to change the options)
plugins: [
`gatsby-plugin-pnpm`,
{
resolve: `gatsby-plugin-sass`,
options: {
sassOptions: {
includePaths: [
`./node_modules/@uswds/uswds`,
`./node_modules/@uswds/uswds/packages`,
],
},
},
},
{
resolve: `gatsby-plugin-i18n-l10n`,
options: {
// IETF BCP 47 language tag: default locale, which won't be prefixed
defaultLocale: `en-US`,
// string: absolute site url
siteUrl: process.env.SITE_URL,
prefix: `en`,
// locales[]: all locales, which should be available
locales: [
{
// IETF BCP 47 language tag of this language
locale: `en-US`,
// string: prefix for this language, which will be used to prefix the url, if it's not the default locale
prefix: `en`,
// object: mapping of given urls (by filename) to translated urls, if no mapping exists, given url will be used
slugs: {},
// object: this messages will be handed over to react-intl and available throughout the website
messages: enUSMessages,
},
{
// IETF BCP 47 language tag of this language
locale: `es-MX`,
// string: prefix for this language, which will be used to prefix the url, if it's not the default locale
prefix: `es`,
// object: mapping of given urls (by filename) to translated urls, if no mapping exists, given url will be used
slugs: {},
// object: this messages will be handed over to react-intl and available throughout the website
messages: esMXMessages,
},
],
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `scorecards`,
path: path.join(__dirname, `/src/data/scorecards`),
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: path.join(__dirname, `/src/data/images`),
},
},
`gatsby-transformer-csv`,
`gatsby-plugin-image`,
`gatsby-plugin-sharp`,
`gatsby-transformer-sharp`,
],
jsxRuntime: `automatic`,
};
export default config;