-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.js
47 lines (41 loc) · 1 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
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 HTTPS = Boolean(process.env.HTTPS) ? "https" : "http";
const HOST = process.env.VERCEL ? "" : `${HTTPS}://${process.env.HOST || "localhost:3000"}`;
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
compiler: {
removeConsole: {
exclude: getExcludedConsole(),
},
},
env: {
production,
},
i18n: {
defaultLocale: "ko",
locales: ["ko", "en"],
},
serverRuntimeConfig: {
API_HOST: HOST,
},
publicRuntimeConfig: {
VERCEL_ENV,
COMMIT_SHA: process.env.VERCEL_GIT_COMMIT_SHA || "local-development",
API_HOST: HOST,
},
};
module.exports = nextConfig;