-
Notifications
You must be signed in to change notification settings - Fork 0
/
static.config.ts
42 lines (40 loc) · 1.23 KB
/
static.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
import * as path from 'path';
import { ContentfulApi } from './src/contentful/api';
import RouteGenerator from './src/contentful/RouteGenerator';
require('dotenv').config();
const client = new ContentfulApi({
space: process.env.CONTENTFUL_SPACE,
accessToken: process.env.CONTENTFUL_DELIVERY_ACCESS_TOKEN,
environment: process.env.CONTENTFUL_ENV
});
export default {
entry: path.resolve('./src/app/index.tsx'),
getSiteData: async () => {
const routeGenerator = new RouteGenerator(client);
return routeGenerator.getSiteData();
},
getRoutes: async () => {
const routeGenerator = new RouteGenerator(client);
return routeGenerator.getRoutes();
},
plugins: [
'react-static-plugin-typescript',
[
require.resolve('react-static-plugin-source-filesystem'),
{
location: path.resolve('./src/tests/pages')
}
],
require.resolve('react-static-plugin-reach-router'),
require.resolve('react-static-plugin-sitemap'),
[
'react-static-plugin-sass',
{
includePaths: ['src/app/', 'src/app/scss'] // always includes `src/`
// other options for the sass-loader
}
],
'react-static-plugin-scss-modules-rw',
'react-static-plugin-file-replace'
]
};