Open yoiang opened 6 years ago
+1
I have this issue as well, but I find the parent folder index.js imports the child folder the same as if it were a file, which is giving me errors:
export { default as dirname } from './dirname';
I believe (and could definitely be wrong) it should import the directory like this (and this works in my projects):
import * as dirname from './dirname';
export { dirname };
@yoiang - Is this similar to your issue/findings?
@SharpSeeEr I don't recall, it's been a while. Sorry~!
I am seeing the same issue, create-index does not handle named exports at all
@SharpSeeEr There is an even better way:
export * as dirNamedExports from './dir'
Hello! Thanks so much for the great work on create-index! I apologize if this has been brought up before, after some time of searching the issues and pull requests I could not find mention of it.
I have a library project with some deeper source folders and much to my delight create-index does indeed create
index.js
files exactly how I was looking for, short of one thing. When creating a parent folder'sindex.js
and using the recurse into subfolders option the parent folder'sindex.js
will not import the child folder's. To further call the inconsistency out, subsequent runs of create-index will properly import the child folder's now createdindex.js
.I'd be happy to submit a PR if this seems like a feature that should be included, especially if it's something someone unfamiliar with the source can easily jump in and do, say if it's a matter of swapping the order of generation.
Thank you for your time!