question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

importAll as transform.

See original GitHub issue

@kentcdodds first off, thanks for the badass macro.

One thing I was thinking about is using svgr and importAll.

e.g. using https://github.com/evenchange4/svgr.macro

and this together.

basically I’d like to be able to do something like this

import my svg files, transform them using svgr and output a const icons object which has the mapping of the component names so I can then create an Icon component which picks one from the icons by a name prop.

Is this currently possible? Or could we add this kind of transform function to import-all?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lifeiscontentcommented, May 23, 2018

@kentcdodds actually, upon further review, svgr.macro has support for globs. so… I guess nevermind.

0reactions
kentcdoddscommented, May 23, 2018

Sure! I have a weekly newsletter and just last week my newsletter was about creating custom babel-plugin-macros macros 😃 Read it here.

I also link to some videos and other material at the end there too. Good luck!

Read more comments on GitHub >

github_iconTop Results From Across the Web

importAll - Command Reference - Informatica Documentation
When you import objects, verify that the file contains all the supporting objects. The uploadFile command uses the following syntax: rpcmd importAll <-URL|-u> ......
Read more >
kentcdodds/import-all.macro - GitHub
A babel-macro that allows you to import all files that match a glob - GitHub ... Configure importAll to transform import path before...
Read more >
Import all sheets from all files in a folder into Excel
Get and Transform Excel 2016 - Import data from folder. Click on 'Browse' and browse for the folder that contain the files, then...
Read more >
Import ECharts - Basics - The Apache Software Foundation!
The above code will import all the charts and components in ECharts, ... title, rectangular coordinate system, dataset and transform components import ...
Read more >
Get data from folder in Power Query: combine files quickly
In this post, we use Power Query to import all the files in a folder. ... Instead, we click Transform Data and take...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found