-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
35 lines (34 loc) · 914 Bytes
/
next.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
/** @type {import('next').NextConfig} */
const {
PHASE_DEVELOPMENT_SERVER,
PHASE_PRODUCTION_BUILD,
PHASE_PRODUCTION_SERVER,
} = require('next/constants');
module.exports = (phase, { defaultConfig }) => {
if (phase === PHASE_DEVELOPMENT_SERVER) {
return {
reactStrictMode: true,
publicRuntimeConfig: {
graphqlUrlClient: process.env.GRAPHQL_URL_CLIENT,
toolbarColor: process.env.TOOLBAR_COLOR,
},
serverRuntimeConfig: {
graphqlUrlSsr: process.env.GRAPHQL_URL_SSR,
},
};
} else if (
phase === PHASE_PRODUCTION_BUILD ||
phase === PHASE_PRODUCTION_SERVER
) {
return {
publicRuntimeConfig: {
graphqlUrlClient: process.env.GRAPHQL_URL_CLIENT,
toolbarColor: process.env.TOOLBAR_COLOR,
},
serverRuntimeConfig: {
graphqlUrlSsr: process.env.GRAPHQL_URL_SSR,
},
env: {},
};
}
};