-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support creating index with default export #61
Comments
Open to it. As long as it is behind a flag, I see no harm. |
I definitely support any improvements from create-index-better being upstreamed. I haven’t the bandwidth to do that atm, but I’m happy to interface with someone who does if that’s helpful. |
@bmish why? |
Example of the index file I need to generate: |
@bmish But why can't you just export named and use |
@ChocolateLoverRaj I'm unclear what you mean by that. Can you show an example? |
@ChocolateLoverRaj I'm not sure how that helps me. I need to re-export every file in a directory. |
@bmish In the file you can do this: // letters.js
export const a = 0
export const b = 1
export const c = 2 Instead of default export. Then In the file you want to import the first file with you can do this: import * as letters from './letters.js'
letters.a // 0
letters.b // 1
letters.c // 2 |
Currently, this plugin only supports creating an index with named exports. I need an index file with a default-exported object.
Example:
I see this functionality is in a forked version of this tool: https://github.com/tjjfvi/create-index-better#modes
Has it been considered for the original
create-index
? @tjjfvi would you consider upstreaming this functionality (and presumably any other improvements from the fork)?The text was updated successfully, but these errors were encountered: