unjs / c12

⚙️ Smart Configuration Loader
MIT License
499 stars 19 forks source link

Support array configurations for multi config #92

Open pi0 opened 1 year ago

pi0 commented 1 year ago

When the default export is an array we need to support resolving multi configs (might be a new export loadConfig)

sadeghbarati commented 7 months ago

https://github.com/cosmiconfig/cosmiconfig?tab=readme-ov-file#searchplaces

for example, I want to search for these two words

components.json - components-vue.json

const configResult = await c12LoadConfig({
  name: ['components', 'components-vue'],
  configFile: ['components', 'components-vue'],
  cwd,
})
mrlubos commented 4 months ago

+1, this would be really nice! I can create a pull request if there's interest in getting it merged?

pi0 commented 3 months ago

@sadeghbarati this is also another good idea (this issue is for supporting an export with array of configs. i understand what you wanted is to search for multiple names moved to ~> https://github.com/unjs/c12/issues/157)

@mrlubos PR welcome for either ;)