-
Notifications
You must be signed in to change notification settings - Fork 15
/
gatsby-config.js
121 lines (118 loc) · 3.41 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
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
const path = require('path')
// eslint-disable-next-line import/no-extraneous-dependencies
const { createProxyMiddleware } = require('http-proxy-middleware')
// eslint-disable-next-line import/no-extraneous-dependencies
require('dotenv').config({
path: `.env.${process.env.NODE_ENV}`,
})
module.exports = {
siteMetadata: {
title: 'Dindim',
description: 'Stripe storefront starter for Gatsby',
author: 'Lorenzo García Moreno <dev@lorenzogm.com>',
},
plugins: [
'gatsby-plugin-eslint',
{
resolve: `gatsby-plugin-layout`,
options: {
component: require.resolve(`./src/components/templates/LayoutTemplate/LayoutTemplate`),
},
},
{
resolve: 'gatsby-plugin-root-import',
options: {
src: path.join(__dirname, 'src'),
components: path.join(__dirname, 'src/components'),
constants: path.join(__dirname, 'src/constants'),
context: path.join(__dirname, 'src/context'),
graphql: path.join(__dirname, 'src/graphql'),
pages: path.join(__dirname, 'src/pages'),
services: path.join(__dirname, 'src/services'),
theme: path.join(__dirname, 'src/theme'),
utils: path.join(__dirname, 'src/utils'),
},
},
'gatsby-plugin-react-helmet',
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'images',
path: `${__dirname}/src/images`,
},
},
'gatsby-transformer-sharp',
'gatsby-plugin-sharp',
{
resolve: 'gatsby-plugin-manifest',
options: {
name: 'gatsby-starter-default',
short_name: 'starter',
start_url: '/',
background_color: '#663399',
theme_color: '#663399',
display: 'minimal-ui',
icon: 'src/images/icon.png', // This path is relative to the root of the site.
},
},
{
resolve: 'gatsby-source-stripe',
options: {
objects: ['Product', 'Sku'],
secretKey: process.env.GATSBY_STRIPE_SECRET_KEY,
downloadFiles: true,
auth: false,
},
},
{
resolve: 'gatsby-plugin-material-ui',
options: {
stylesProvider: {
injectFirst: true,
},
},
},
'gatsby-plugin-styled-components',
{
resolve: `gatsby-plugin-react-i18next`,
options: {
path: `${__dirname}/locales`,
languages: [`en`, `es`],
defaultLanguage: `en`,
// you can pass any i18next options
// pass following options to allow message content as a key
i18nextOptions: {
interpolation: {
escapeValue: false, // not needed for react as it escapes by default
},
keySeparator: false,
nsSeparator: false,
},
},
},
{
resolve: `gatsby-plugin-gtag`,
options: {
// your google analytics tracking id
trackingId: process.env.GATSBY_GOOGLE_ANALYTICS_TRACKING_ID,
// Puts tracking script in the head instead of the body
head: false,
// enable ip anonymization
anonymize: true,
},
},
],
// for avoiding CORS while developing Netlify Functions locally
// read more: https://www.gatsbyjs.org/docs/api-proxy/#advanced-proxying
developMiddleware: (app) => {
app.use(
'/.netlify/functions/',
createProxyMiddleware({
target: 'http://localhost:9000',
pathRewrite: {
'/.netlify/functions/': '',
},
}),
)
},
}