We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
like this:
configureSvgIcon({ destination: path.join(__dirname, 'src', 'Icon.js'), svgDir: [ path.join(__dirname, 'src', 'svg'), path.join(__dirname, 'demo', src', 'svg') ], });
The text was updated successfully, but these errors were encountered:
Nice. I think something like this would work:
diff --git a/src/configureGenerator.js b/src/configureGenerator.js index 24fb5e3..7c17391 100644 --- a/src/configureGenerator.js +++ b/src/configureGenerator.js @@ -18,16 +18,15 @@ export default function configureGenerator(config) { : path.join(process.cwd(), template); const templateContent = fs.readFileSync(templateFile).toString(); - const svgDir = path.isAbsolute(config.svgDir) - ? config.svgDir - : path.join(process.cwd(), config.svgDir); - - console.log('Looking for SVG Icons in:', svgDir); // eslint-disable-line no-console + const svgDirs = Array.isArray(config.svgDir) ? config.svgDir : [config.svgDir]; + const svgs = svgDirs.reduce((result, d) => { + const svgDir = path.isAbsolute(d) ? d : path.join(process.cwd(), d); + console.log('Looking for SVG Icons in:', svgDir); // eslint-disable-line no-console + return [].concat(getSvsgInDir(svgDir)); + }, []); console.log('Using Icon template from:', templateFile); // eslint-disable-line no-console - const svgs = getSvsgInDir(svgDir); - const iconDestination = config.destination || path.join(process.cwd(), 'Icon.react.js');
Sorry, something went wrong.
No branches or pull requests
like this:
The text was updated successfully, but these errors were encountered: