Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override SVGO config using .svgrrc file #143

Closed
tk-o opened this issue Jul 20, 2018 · 5 comments
Closed

Override SVGO config using .svgrrc file #143

tk-o opened this issue Jul 20, 2018 · 5 comments

Comments

@tk-o
Copy link

tk-o commented Jul 20, 2018

I'm using Create React App tool (react-scripts@2.0.0-next.3e165448) and saw this PR has been merged already facebook/create-react-app#3907.

I'd like to disable a few svgo plugins in order to load svg sprite file. I created .svgrrc.json file in the project root directory:

{
  "svgoConfig": {
    "plugins": [{ "cleanupIDs": false }, { "removeUselessDefs": false }]
  }
}

Unfortunately this config seems not to be passed down to svgo tool.

Actual result:
image

Although once I go to node_modules/svgo/.svgo.yml file and set these two options manually to false, everything is working as expected.
Expected result:
image

PS. I already had this issue with svgr@1.x #36 and found the solution here, so I believe my current problem can be solved here as well.

@gregberge
Copy link
Owner

create-react-app is using SVGR v1, .svgrrc is a v2 feature.

I will try to make a PR to upgrade it in create-react-app.

@tk-o
Copy link
Author

tk-o commented Jul 21, 2018

Yeah, I found it out. Already created the PR on CRA facebook/create-react-app#4799

@gregberge
Copy link
Owner

Thanks!

@tk-o
Copy link
Author

tk-o commented Jul 22, 2018

I'll be glad if you review it, so it's gets merged sooner ;)

@gregberge
Copy link
Owner

@kopacki I can't review on create-react-app sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants