Skip to content
Merged

Dev #169

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
Expand All @@ -13,6 +16,31 @@ const nextConfig = {
},
],
},
webpack: (config) => {
// 기존 SVG 파일 로더 규칙을 찾습니다.
const fileLoaderRule = config.module.rules.find((rule) =>
rule.test?.test?.('.svg')
);

config.module.rules.push(
// 기존 규칙을 재적용하되, ?url 로 끝나는 SVG 파일에만 적용합니다.
{
...fileLoaderRule,
test: /\.svg$/i,
resourceQuery: /url/, // *.svg?url
},
// 나머지 *.svg 파일을 React 컴포넌트로 변환합니다.
{
test: /\.svg$/i,
issuer: fileLoaderRule.issuer,
resourceQuery: {
not: [...fileLoaderRule.resourceQuery.not, /url/],
}, // *.svg?url 제외
use: ['@svgr/webpack'],
}
);
return config;
},
};

export default nextConfig;
Loading