-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.ts
More file actions
41 lines (37 loc) · 1.15 KB
/
next.config.ts
File metadata and controls
41 lines (37 loc) · 1.15 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
import type { NextConfig } from 'next';
const nextConfig: NextConfig = {
/* config options here */
reactStrictMode: false, // Strict Mode 비활성화
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'ezcode-s3.s3.ap-northeast-2.amazonaws.com',
pathname: '/**',
},
],
},
webpack(config) {
// Grab the existing rule that handles SVG imports
const fileLoaderRule = config.module.rules.find((rule: any) => rule.test?.test?.('.svg'));
config.module.rules.push(
// Convert all other *.svg imports to React components
{
test: /\.svg$/i,
include: /src\/assets/, // Only target SVG files in /src/assets
use: ['@svgr/webpack'], // Use @svgr/webpack for SVG to React component conversion
},
{
test: /\.svg$/i,
include: /public/, // Only target SVG files in /public
type: 'asset/resource', // Use asset module to handle SVG as a static file (no need for file-loader)
}
);
if (fileLoaderRule) {
fileLoaderRule.exclude = /\.svg$/i;
}
return config;
},
output: 'standalone',
};
export default nextConfig;