Import SVGs as components in webpack

Install `svgr`:

```bash
npm install --save-dev @svgr/webpack
```

Add an import rule for svgs:

```javascript
module.exports = {
  module: {
    rules: [
      {
        test: /\.svg$/i,
        use: ['@svgr/webpack'],
      },
    ],
  },
}
```

Voilà!

```jsx
import Star from './star.svg'

const Example = () => (
  <div>
    <Star />
  </div>
)
```

kevin-perez
December 9, 2024
