forked from ocf/ocfstatic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-config.ts
43 lines (40 loc) · 982 Bytes
/
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
import type { GatsbyConfig } from "gatsby"
import { config as dotenv } from "dotenv"
import { createProxyMiddleware } from "http-proxy-middleware"
import type { Application as ExpressApp } from "express"
import { API_HOST } from "./src/utils/api"
dotenv({
path: `.env.${process.env.NODE_ENV ?? "development"}`,
})
const config: GatsbyConfig = {
siteMetadata: {
title: `ocfstatic`,
siteUrl: `https://new.ocf.berkeley.edu`,
},
jsxRuntime: "automatic",
plugins: [
{
resolve: "@chakra-ui/gatsby-plugin",
options: {
/**
* @property {boolean} [resetCSS=true]
* if false, this plugin will not use `<CSSReset />
*/
resetCSS: true,
},
},
],
developMiddleware: (app: ExpressApp) => {
app.use(
"/api",
createProxyMiddleware({
target: API_HOST(),
pathRewrite: {
"^/api": "",
},
changeOrigin: true,
})
)
},
}
export default config