-
Notifications
You must be signed in to change notification settings - Fork 0
/
svgr.config.js
51 lines (50 loc) · 1.03 KB
/
svgr.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
const componentTemplate = require("./src/templates/defaultTemplate.js");
module.exports = {
typescript: true,
icon: false,
dimensions: false,
titleProp: true,
plugins: [
// Clean SVG files using SVGO
"@svgr/plugin-svgo",
// Generate JSX
"@svgr/plugin-jsx",
// Format the result using Prettier
"@svgr/plugin-prettier",
],
replaceAttrValues: {
black: "currentColor",
"#000": "currentColor",
"#000000": "currentColor",
},
svgoConfig: {
plugins: [
"sortAttrs",
"removeScriptElement",
"removeDimensions",
{
name: "removeAttrs",
params: {
attrs: ["path:stroke-width"],
},
},
{
name: "addAttributesToSVGElement",
params: {
attributes: [
{
"stroke-width": 1.2,
},
{
stroke: "currentColor",
},
{
"aria-hidden": true,
},
],
},
},
],
},
template: componentTemplate,
};