Skip to content

Commit

Permalink
feat: @svgr/webpack을 이용한 svg 컴포넌트화 MARA-12
Browse files Browse the repository at this point in the history
  • Loading branch information
a-honey committed Jan 9, 2024
1 parent feeca13 commit b09e384
Show file tree
Hide file tree
Showing 5 changed files with 930 additions and 597 deletions.
19 changes: 17 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
}
webpack: (config) => {
return {
...config,
module: {
...config.module,
rules: [
...(config.module.rules || []),
{
test: /\.svg$/,
use: ['@svgr/webpack'],
},
],
},
};
},
};

module.exports = nextConfig
module.exports = nextConfig;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"@storybook/nextjs": "7.6.3",
"@storybook/react": "7.6.3",
"@storybook/test": "7.6.3",
"@svgr/webpack": "^8.1.0",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
Expand Down
70 changes: 3 additions & 67 deletions src/components/atoms/icons/FoodIcons.tsx

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Inter } from 'next/font/google'
import AppleIconSvg from '../assets/icons/Frame 35.svg';
import { AppleIcon } from '@/components/atoms/icons/FoodIcons';
import { Inter } from 'next/font/google';

const inter = Inter({ subsets: ['latin'] })
const inter = Inter({ subsets: ['latin'] });

export default function Home(): JSX.Element {
return (
Expand All @@ -9,7 +11,9 @@ export default function Home(): JSX.Element {
>
<div className="mb-32 grid text-center lg:max-w-5xl lg:w-full lg:mb-0 lg:grid-cols-4 lg:text-left">
mara web
<AppleIconSvg />
<AppleIcon />
</div>
</main>
)
);
}
Loading

0 comments on commit b09e384

Please sign in to comment.