Open serhiipalash opened 7 years ago
I've actually started working on the first one, the nested folder structure system, this morning. :) It will be my first public open source pull request. I've got the initial use case setup, but I'm working on making sure it is fully recursive so I'm working on the importing multiple files deeply now and I still need to figure out the best way to handle index.js
(I may save this for another go Pull Request later). This is also my first time working on a babel plugin.
https://github.com/RayBenefield/babel-plugin-wildcard/tree/Recursive-Imports
Still working on it and hopefully I'll get it done in the next day or two as I need it for a project I'm working on too.
As for the second one, that looks interesting, for me that feels out of scope for this plugin as it isn't really a "wildcard" thing.
I've actually started working on the first one
Great! Good luck!
I've put in the initial pull request for the first portion (#11). However it doesn't solve your use case @serhiipalash . It doesn't specially handle index.js
and I haven't quite figured out filtering yet. Right now it just handles:
|- index.js
|- dir
|- a.js
|- c.js
|- nested
|- b.js
the allowing JS:
import * as Items from './dir';
console.log(Items.Nested.B());
Hello! Very nice plugin! Can you add more functionality to it?
1) Possibility to import nested folder's index.js by folder name. I have such a project structure
Is it possible to import components like this?
2) Possibility to import nested folder's directory named file by folder name like Webpack
DirectoryNamedWebpackPlugin
does There is an implementation of it for Babel, but it is not supported any more. https://github.com/mdluo/babel-plugin-directory-named-module/issues/1It would be great to get rid of
index.js
all over my React Native project. Thanks in advance for your help!