Skip to content

Commit

Permalink
Merge pull request #19 from Nexters/feat/#15
Browse files Browse the repository at this point in the history
[Feat/#15] 공통 컴포넌트 구현
  • Loading branch information
Jxxunnn authored Jan 28, 2025
2 parents 7a0069a + 65954f9 commit 0c5bc59
Show file tree
Hide file tree
Showing 59 changed files with 4,529 additions and 751 deletions.
27 changes: 27 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,33 @@ const nextConfig = {
compiler: {
styledComponents: true,
},

webpack(config) {
// Grab the existing rule that handles SVG imports
const fileLoaderRule = config.module.rules.find((rule) =>
rule.test?.test?.(".svg"),
);

config.module.rules.push(
// Reapply the existing rule, but only for svg imports ending in ?url
{
...fileLoaderRule,
test: /\.svg$/i,
resourceQuery: /url/, // *.svg?url
},
// Convert all other *.svg imports to React components
{
test: /\.svg$/i,
issuer: fileLoaderRule.issuer,
resourceQuery: { not: [...fileLoaderRule.resourceQuery.not, /url/] }, // exclude if *.svg?url
use: ["@svgr/webpack"],
},
);
// Modify the file loader rule to ignore *.svg, since we have it handled now.
fileLoaderRule.exclude = /\.svg$/i;

return config;
},
};

export default nextConfig;
Loading

0 comments on commit 0c5bc59

Please sign in to comment.