Svgr: how i make multiple replace

Created on 15 Nov 2018  路  4Comments  路  Source: gregberge/svgr

this work :

npx @svgr/cli -d assets/svgr assets/svg --replace-attr-values "#3abca7={props.color1}"  --replace-attr-values "hid1={props.hid1}"

but i need for every value use --replace-attr-values its possible use multiple in one
and help write this as webpack package.json script
right now i use it as

"scripts": {
   "SVGR":"npx @svgr/cli -d assets/svgr assets/svg --replace-attr-values '#3abca7={props.color1}'  --replace-attr-values 'hid1={props.hid1}'"
}
help wanted 馃啒 v5

Most helpful comment

In v5, you would be able to use , as separator:

npx @svgr/cli -d assets/svgr assets/svg --replace-attr-values "#3abca7={props.color1},hid1={props.hid1}"

All 4 comments

Hello @gwmaster, I am sorry but I don't understand your problem. Can you try to explain it better?

I think he's trying to say that he needs to replace multiple attribute values, and he's currently just adding --replace-attr-values for every single one. He's looking for a way to include multiple replacement values in one go.

Yeah but it is not currently possible, I am sorry this is the way to handle it in CLI.

In v5, you would be able to use , as separator:

npx @svgr/cli -d assets/svgr assets/svg --replace-attr-values "#3abca7={props.color1},hid1={props.hid1}"
Was this page helpful?
0 / 5 - 0 ratings

Related issues

smashercosmo picture smashercosmo  路  3Comments

alamothe picture alamothe  路  6Comments

runeh picture runeh  路  4Comments

kg-currenxie picture kg-currenxie  路  4Comments

troch picture troch  路  5Comments