babel-plugin-wildcard icon indicating copy to clipboard operation
babel-plugin-wildcard copied to clipboard

can't make it work with a directory of .svg file

Open naderbm opened this issue 6 years ago • 8 comments

i have a directory : |- dir |- a.svg |- b.svg |- c.svg when i do import * as Items from './dir'; i got a undefined object.

naderbm avatar Dec 09 '18 17:12 naderbm

Did you make sure to add svg under 'exts' option?: https://github.com/vihanb/babel-plugin-wildcard#exts

vihanb avatar Dec 09 '18 21:12 vihanb

i add it in .babelrc file and i still getting undefined object. 2018-12-10 at 10-49-57

naderbm avatar Dec 10 '18 09:12 naderbm

Very weird... can you copy and paste the code generated by Babel?

vihanb avatar Dec 10 '18 16:12 vihanb

import * as svgList from './svg/*'
export default svgList

same problem

This relative module was not found:

* ./svg/* in ./static/svgs.js```

AndreiSoroka avatar Mar 14 '19 15:03 AndreiSoroka

Does this plugin even work? @AndreiSoroka did you ever find a solution to your problem?

JoNilsson avatar Jan 03 '20 03:01 JoNilsson

@JoNilsson , sorry. I didn't remember...

AndreiSoroka avatar Jan 04 '20 01:01 AndreiSoroka

Hey, @AndreiSoroka. I appreciate the reply.
Pulled https://github.com/vihanb/babel-plugin-wildcard/pull/33 this fork, and solved my particular issue, with Subdirectories. Frustrating a little bit.

Yo @vihanb do you need a hand with the maintenance?

JoNilsson avatar Jan 04 '20 01:01 JoNilsson

Merged #33. I don't have too much time for maintaining this though, so if anyone is interested in picking it up. Feel free to make a PR, and I'll review+grant npm/github perms

vihanb avatar Jan 04 '20 01:01 vihanb