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

Have the ability to set SVGR built-in configuration #389

Closed
danielbayerlein opened this issue Oct 5, 2018 · 10 comments
Closed

Have the ability to set SVGR built-in configuration #389

danielbayerlein opened this issue Oct 5, 2018 · 10 comments

Comments

@danielbayerlein
Copy link

Question

How can I configure the SVGR built-in?

My current loader looks like this:

test: /\.svg$/,
use: {
  loader: '@svgr/webpack',
  options: {
    icon: true,
    replaceAttrValues: {
      '#1a171b': 'currentColor'
    }
  }
}
@lasimonne
Copy link

You can use the modifyBundlerConfig

// doczrc.js
export default {
  modifyBundlerConfig: (config) => {
    /* custom loaders */
    config.module.rules.push({
        test: /\.svg$/,
        use: '@svgr/webpack',
    });
    return config
  }
}

@danielbayerlein
Copy link
Author

@lasimonne In your example you add the @svgr/webpack loader, but it is already integrated in the new version of docz. Let me know if I misunderstood something.

@lasimonne
Copy link

@danielbayerlein I might have misunderstood you, are you talking about .svgrrc configuration?

@danielbayerlein
Copy link
Author

@lasimonne Thanks, I did not know the configuration file! But it looks like the configuration file is ignored. 😕

@danielbayerlein
Copy link
Author

@pedronauck
Copy link
Member

Hi @danielbayerlein, that's is something that we need to put on doczrc. I'll do that and put for the last release 🙏

@pedronauck pedronauck reopened this Nov 5, 2018
@pedronauck pedronauck changed the title How can I configure the SVGR built-in? Have the ability to set SVGR built-in configuration Nov 5, 2018
@danielbayerlein
Copy link
Author

Hi @pedronauck, thank you! You can configure SVGR itself via .svgrrc, svgr.config.js or svgr key in the package.json file.

@pedronauck
Copy link
Member

oh, really? and this work actually with docz too @danielbayerlein ?

@danielbayerlein
Copy link
Author

@pedronauck Yes, the configuration file .svgrrc works fine.

@pedronauck
Copy link
Member

Cool! So, I'll let just this config instead of put a new property on doczrc, thanks to the tip dude 🙏

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

3 participants