electron-userland / electron-userland/electron-webpack
Unable to Import svg as React Component
- Dominant language
- TypeScript
- Stars
- 902
- Forks
- 168
- PR merge metrics
- No merged PRs in 30d
Description
* **electron-builder Version**: 22.9.1
* **electron-webpack Version**: 2.8.2
* **Target**: Windows, Mac
I'm trying to import a SVG as a React Component.
```js
import { ReactComponent as Icon} from "../assets/icon.svg";
```
When i try to do this, i get errors like this.

I've tried using svgr without any luck.
webpack.main.additions.js
```js
module.exports = (config) => {
return {
...config,
devtool: false,
module: {
rules: [
{
test: /\.ts$/,
loader: "ts-loader",
},
{
test: /\.html$/,
use: "html-loader",
},
{
test: /\.svg$/,
use: ["@svgr/webpack"],
},
],
},
};
};
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.