babel-plugin-wildcard
babel-plugin-wildcard copied to clipboard
Proper File Globbing with Recursive Imports
PR #10 introduced File Globbing, and shortly afterwards PR #11 introduced Recursive Imports. However the two features do not mesh properly together.
For example:
|- index.js
|- dir
|- before_a.js
|- c.js
|- before_nested
|- b.js
The following should be possible:
import * as Before from './dir/before_*';
console.log(Before.BeforeA()); // Whatever is in './before_a.js'
console.log(Before.BeforeNested.B()); // Whatever is in './before_nested/b.js'
@drgould does the above look right to you?
Yeah, that looks correct.
Wouldn't a recursive glob statement look like this?
import * as Before from './dir/**/before_*';