Skip to content

Commit 0c5bc59

Browse files
authored
Merge pull request #19 from Nexters/feat/#15
[Feat/#15] 공통 컴포넌트 구현
2 parents 7a0069a + 65954f9 commit 0c5bc59

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+4529
-751
lines changed

next.config.mjs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,33 @@ const nextConfig = {
33
compiler: {
44
styledComponents: true,
55
},
6+
7+
webpack(config) {
8+
// Grab the existing rule that handles SVG imports
9+
const fileLoaderRule = config.module.rules.find((rule) =>
10+
rule.test?.test?.(".svg"),
11+
);
12+
13+
config.module.rules.push(
14+
// Reapply the existing rule, but only for svg imports ending in ?url
15+
{
16+
...fileLoaderRule,
17+
test: /\.svg$/i,
18+
resourceQuery: /url/, // *.svg?url
19+
},
20+
// Convert all other *.svg imports to React components
21+
{
22+
test: /\.svg$/i,
23+
issuer: fileLoaderRule.issuer,
24+
resourceQuery: { not: [...fileLoaderRule.resourceQuery.not, /url/] }, // exclude if *.svg?url
25+
use: ["@svgr/webpack"],
26+
},
27+
);
28+
// Modify the file loader rule to ignore *.svg, since we have it handled now.
29+
fileLoaderRule.exclude = /\.svg$/i;
30+
31+
return config;
32+
},
633
};
734

835
export default nextConfig;

0 commit comments

Comments
 (0)