-
Notifications
You must be signed in to change notification settings - Fork 87
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
(Feature) Add custom template function #43
Conversation
What are those use cases? This looks like a style issue. |
For my particular use case now I am exporting GraphQL modules as such:
I would like to manufacture an index where I can import from ./types and get:
But the application has way more potential. For example when working with Redux and React, having the ability to do |
@gajus have you made a decision whether to accept this change? |
I would rather keep this addition out of this particular project. I can leave the PR open and see if more people 👍 . Meanwhile, you can just for the project. |
Alright, I'll maintain a fork of this project @ create-exports-index. I would like to ask you to reconsider given that there have been three requests for this feature and I myself have run into several use cases where I want to change what's exported. It's not really a matter of style but rather the current output is limiting in scope of use. Thanks for your time 👍 |
I'd also request this be part of the main package. In my scenario, we are restricting the use of default exports and using only named (good practice for tree shaking, amongst other reasons). Therefore our requirement is for create-index to output the following:
We shall migrate over to @coleturner's package. |
@coleturner your NPM package doesn't appear to be built. There is no dist folder. I get the following error:
|
@develomark apologies, I published in haste. Try v1.3.0@create-exports-index |
@coleturner thanks!! |
I too require a custom template. @coleturner thanks for forking |
This pull request adds the ability to customize the output of create-index, to create different kinds of exports:
Doing so allows the customization for a couple uses cases I've experienced personally and have seen in the issues here.
This change only affects the API. I was not sure what to do for the client, I would suppose a good way to add support would to add a
--template file/path.js
flag where the JS file must export a function. @gajus please let me know if you have any thoughts on that matter.Cheers!