vihanb / babel-plugin-wildcard

Wildcard imports import a directories JS files
MIT License
186 stars 27 forks source link

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

Open naderbm opened 5 years ago

naderbm commented 5 years ago

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

vihanb commented 5 years ago

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

naderbm commented 5 years ago

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

vihanb commented 5 years ago

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

AndreiSoroka commented 5 years ago
import * as svgList from './svg/*'
export default svgList

same problem


This relative module was not found:

* ./svg/* in ./static/svgs.js```
JoNilsson commented 4 years ago

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

AndreiSoroka commented 4 years ago

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

JoNilsson commented 4 years ago

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?

vihanb commented 4 years ago

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