-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
59 lines (55 loc) · 1.4 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 webpack = require("webpack");
const withPlugins = require("next-compose-plugins");
const withPWA = require("next-pwa");
/**
* next/image 허용 호스트 배열
* @type {string[]}
* @description Protocol을 제외한 Domain 문자열을(Sub-domain 포함) 배열로 작성하면, `nextConfig.images.remotePatterns`에 자동으로 추가됩니다.
*/
const allowImageHosts = [
"imagedelivery.net",
"assets-unithon-10th-team8-prod.betaman.xyz",
"assets-unithon-10th-team8-dev.betaman.xyz",
];
/** @type {import('next').NextConfig} */
const nextConfig = {
productionBrowserSourceMaps: true,
reactStrictMode: true,
swcMinify: true,
output: "standalone",
images: {
unoptimized: true,
},
webpack: (config, { dev, isServer }) => {
config.plugins.push(
new webpack.DefinePlugin({
"process.env.RELEASE_ENV": JSON.stringify(
process.env.RELEASE_ENV ?? "development",
),
}),
);
if (!dev && !isServer) {
Object.assign(config.resolve.alias, {
"react/jsx-runtime.js": "preact/compat/jsx-runtime",
react: "preact/compat",
"react-dom/test-utils": "preact/test-utils",
"react-dom": "preact/compat",
});
}
return config;
},
transpilePackages: [],
};
module.exports = withPlugins(
[
[
withPWA,
{
pwa: {
dest: "public",
},
},
],
],
nextConfig,
);