jacobmischka / gatsby-plugin-react-svg

Adds svg-react-loader to gatsby webpack config
https://www.npmjs.com/package/gatsby-plugin-react-svg
MIT License
70 stars 21 forks source link

[gatsby-plugin-react-svg] Support multiple asset directories #29

Closed fandy closed 4 years ago

fandy commented 4 years ago

Right now there's only one folder where the plugin will build the SVGs:

plugins: [
  {
    resolve: "gatsby-plugin-react-svg",
    options: {
      rule: {
        include: /assets/ // See below to configure properly
      }
    }
  }
];

It would be great if include accepted an array such that multiple folders can be used.

jacobmischka commented 4 years ago

include is a regular expression, you should be able to include multiple directories using something like /(dir-1|dir-2)/.

jacobmischka commented 4 years ago

Have you been able to give this a shot? Does this work for you?