-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
36 lines (31 loc) · 876 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
36
const {
PHASE_DEVELOPMENT_SERVER,
PHASE_PRODUCTION_BUILD,
} = require("next/constants");
module.exports = (phase) => {
// SET UP OF PHASES
const isDev = phase === PHASE_DEVELOPMENT_SERVER;
const isProd = phase === PHASE_PRODUCTION_BUILD;
console.log(`isDev:${isDev} isProd:${isProd}`);
// 1ST VARIABLE - REACT STRICT MODE
const reactStrictMode = true;
// 2ND VARIABLE - SET IMAGE SECURITY
const images = {
remotePatterns: [
{ protocol: "https", hostname: "m.media-amazon.com" },
],
};
// 3RD VARIABLE - ENV VARIABLES NEEDED BY OUR APP
const env = {
SERVER_NAME: (() => {
if(isDev) return 'http://localhost:3000/';
if(isProd) return 'https://buffy-the-vampire-slayer-and-angel-wiki.vercel.app/'
})(),
NEWS_API_KEY: process.env.NEWS_API_KEY,
}
return {
reactStrictMode,
images,
env,
};
};