-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.ts
More file actions
69 lines (58 loc) · 1.61 KB
/
next.config.ts
File metadata and controls
69 lines (58 loc) · 1.61 KB
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
60
61
62
63
64
65
66
67
68
69
// 🔥 Next.js 16에서 Turbopack 비활성화 공식 방식
export const buildMode = "webpack";
import path from 'path';
import type { NextConfig } from 'next';
import withPWA from 'next-pwa';
const ICON_DIR = path.resolve(__dirname, 'src/shared/icons/source');
const baseConfig: NextConfig = {
reactStrictMode: true,
async redirects() {
return [
{
source: '/',
destination: '/main',
permanent: false,
},
];
},
images: {
remotePatterns: [
{ protocol: 'https', hostname: 'mblogthumb-phinf.pstatic.net' },
{ protocol: 'https', hostname: 'blogfiles.pstatic.net' },
{ protocol: 'https', hostname: 'postfiles.pstatic.net' },
{ protocol: 'https', hostname: 'places.googleapis.com' },
],
},
// 이 webpack 설정이 존재하면 Next 16은 Turbopack 대신 Webpack 빌드 사용
webpack: (config) => {
const svgRule = config.module.rules.find(
// @ts-ignore
(rule) => rule.test && rule.test.test && rule.test.test('.svg'),
);
if (svgRule) {
// @ts-ignore
svgRule.exclude = [...(svgRule.exclude || []), ICON_DIR];
}
config.module.rules.push({
test: /\.svg$/,
include: [ICON_DIR],
use: [
{
loader: require.resolve('svg-sprite-loader'),
options: {
symbolId: 'icon-[name]',
extract: false,
},
},
],
});
return config;
}
};
const withPWABundle = withPWA({
dest: 'public',
register: true,
skipWaiting: true,
buildExcludes: [/dynamic-css-manifest\.json$/],
});
export default withPWABundle(baseConfig);