-
Notifications
You must be signed in to change notification settings - Fork 39
Description
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:
// .config/name.ts
import longConf from './name/key.ts'
export default {
key: longConf
}
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:
export default { /* long config */ }
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 one stat
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.