-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
59 lines (53 loc) Β· 1.36 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
const production = process.env.VERCEL_ENV === "production";
const VERCEL_ENV = process.env.VERCEL_ENV || "local";
function getExcludedConsole() {
const excluded = ["error"];
if (!production) {
excluded.push("log");
excluded.push("warn");
excluded.push("dir");
excluded.push("info");
excluded.push("debug");
}
return excluded;
}
const HOST = process.env.VERCEL
? ""
: `${process.env.HTTPS ? "https" : "http"}://${process.env.HOST || "localhost:3000"}`;
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
compiler: {
removeConsole: {
exclude: getExcludedConsole(),
},
},
env: {
production,
},
serverRuntimeConfig: {
CONFIG: {
API_HOST: HOST || "",
API_PASSWORD: process.env.API_PASSWORD,
adminId: process.env.ADMIN_ID,
adminPw: process.env.ADMIN_PW,
},
AWS: {
region: process.env.AWS_S3_REGION,
Bucket: process.env.AWS_S3_BUCKET,
path: process.env.AWS_S3_PATH,
accessKeyId: process.env.AWS_S3_ACCESS_ID,
secretAccessKey: process.env.AWS_S3_ACCESS_KEY,
},
},
publicRuntimeConfig: {
VERCEL_ENV,
COMMIT_SHA: process.env.VERCEL_GIT_COMMIT_SHA || "local-development",
CONFIG: {
API_PASSWORD: process.env.API_PASSWORD,
API_HOST: HOST || "",
},
},
};
module.exports = nextConfig;