-
Notifications
You must be signed in to change notification settings - Fork 10
/
gatsby-config.js
195 lines (192 loc) · 5.5 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
/**
* Configure your Gatsby site with this file.
*
* See: https://www.gatsbyjs.com/docs/gatsby-config/
*/
/* eslint-disable @typescript-eslint/no-var-requires */
const fs = require('fs');
const path = require('path');
const glob = require('glob');
[
`.env.${process.env.NODE_ENV || 'development'}.local`,
`.env.${process.env.NODE_ENV || 'development'}`,
'.env'
].forEach(env => fs.existsSync(env) && require('dotenv').config({ path: env }));
module.exports = {
siteMetadata: {
title:
'SVL Simulator by LG - Autonomous and Robotics real-time sensor Simulation, LiDAR, ' +
'Camera simulation for ROS1, ROS2, Autoware, Baidu Apollo. Perception, Planning, ' +
'Localization, SIL and HIL Simulation, Open Source and Free.',
description: 'Simulation software to accelerate safe autonomous vehicle development',
author: 'LGEUS ARL',
siteUrl: 'https://www.svlsimulator.com'
},
plugins: [
'gatsby-plugin-root-import',
{
resolve: 'gatsby-plugin-material-ui',
options: {
stylesProvider: {
injectFirst: true
}
}
},
'gatsby-plugin-styled-components',
{
resolve: 'gatsby-plugin-sitemap',
options: {
serialize: ({ site = {}, allSitePage = {} }) => {
const allPages = allSitePage.nodes || (allSitePage.edges || []).map(edge => edge.node);
const allPagesWithStatic = (allPages || [])
.map(p => p.path)
.concat(
glob
.sync('**/*.html', {
nodir: true,
cwd: path.join(__dirname, 'static')
})
.map(p => '/' + p.replace(/\/index.html$/, '/'))
.filter(p => !p.endsWith('/404.html'))
.sort()
);
return allPagesWithStatic.map(pagePath => ({
url: ((site.siteMetadata && site.siteMetadata.siteUrl) || '') + pagePath,
changefreq: 'daily',
priority: 0.7
}));
}
}
},
'gatsby-plugin-robots-txt',
'gatsby-plugin-client-side-redirect',
'gatsby-plugin-sharp',
'gatsby-transformer-sharp',
// Adds automatic typescript type generation for graphql queries
// https://www.gatsbyjs.com/plugins/gatsby-plugin-graphql-codegen/
{
resolve: 'gatsby-plugin-graphql-codegen',
options: {
// documentPaths: ['./src/**/*.{ts,tsx}', './node_modules/gatsby-*/**/*.js']
// documentPaths: ['./src/pages/news/index.tsx']
documentPaths: ['./src/**/*.{ts,tsx}']
}
},
{
resolve: 'gatsby-plugin-webfonts',
options: {
fonts: {
google: [
{
family: 'Open Sans',
variants: ['400', '600', '700']
}
]
}
}
},
{
resolve: 'gatsby-plugin-manifest',
options: {
name: 'SVL Simulator',
short_name: 'SVL Simulator',
start_url: '/',
background_color: '#f7f0eb',
theme_color: '#a2466c',
display: 'standalone',
icon: 'src/images/icon.png'
}
},
// 'gatsby-plugin-offline',
'gatsby-plugin-react-helmet',
{
resolve: 'gatsby-plugin-react-i18next',
options: {
path: `${__dirname}/locales`,
languages: fs.readdirSync(`${__dirname}/locales`),
defaultLanguage: 'en',
siteUrl:
process.env.URL ||
(fs.existsSync(`${__dirname}/static/CNAME`) &&
`https://${fs.readFileSync(`${__dirname}/static/CNAME`, { encoding: 'utf8' }).trim()}`) ||
'localhost:8000',
i18nextOptions: {
lowerCaseLng: true,
interpolation: {
escapeValue: false // not needed for react as it escapes by default
},
returnObjects: true
}
}
},
{
resolve: 'gatsby-plugin-gdpr-cookies',
options: {
googleAnalytics: {
trackingId: process.env.GA_TRACKING_ID
},
environments: ['production', 'development']
}
},
'gatsby-plugin-typescript-checker',
{
resolve: 'gatsby-plugin-eslint',
options: {
test: /\.(js|mjs|jsx|ts|tsx)$/,
exclude: /(node_modules|.cache|public)/,
options: {
eslintPath: require.resolve('eslint'),
resolvePluginsRelativeTo: __dirname,
baseConfig: {
extends: [`${__dirname}/.eslintrc.js`]
},
useEslintrc: false,
emitWarning: true,
failOnError: true
}
}
},
{
resolve: 'gatsby-remark-images',
options: {
linkImagesToOriginal: false,
backgroundColor: 'none'
}
},
'gatsby-remark-autolink-headers',
{
resolve: 'gatsby-plugin-mdx',
options: {
defaultLayouts: {
// posts: require.resolve("./src/components/posts-layout.js"),
default: require.resolve('./src/components/md/Layout.tsx')
},
extensions: ['.mdx', '.md'],
gatsbyRemarkPlugins: [
{
resolve: 'gatsby-remark-images',
options: {
linkImagesToOriginal: false,
backgroundColor: 'none'
}
},
'gatsby-remark-gifs',
'gatsby-remark-autolink-headers'
]
}
},
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'src',
path: `${__dirname}/src/`
}
},
{
resolve: 'gatsby-source-filesystem',
options: {
path: `${__dirname}/src/images`
}
}
]
};