-
Notifications
You must be signed in to change notification settings - Fork 21
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 nested config splitting in .config/
dir
#137
Comments
How about using globby to see all paths starting with |
globby/glob i'm afraid is little more expensive... |
Forgive me! I meant to do glob at the start of load here: Lines 378 to 392 in 0542960
(we're doing a few resolves, but maybe that is still less expensive) Let me try and raise a draft PR as POC to what I mean! |
As a followup to
.config/
dir supports #136 for config-dir proposal.When configuration file size increases (and there is no way to keep it minimal!!), users might prefer to split the configuration into smaller files.
One way is that we just let this task to the users to use manual imports:
This method is clear and also can leave the details up to the end-users on how to split.
Another way is that c12 can allow a conventional way to allow splitting with nested directories:
It can be in:
a.
.config/name/key.ts
b.
.config/name.key.ts
This gives a conventional way of splitting longer configs into smaller files. The main downside is perf. We need at least one
readdir
call in the case of (b) or onestat
in the case of (a).types support for sub-types
it is probably more something that authors have to support but still worth to mention complexities in this dicussion.
The text was updated successfully, but these errors were encountered: