c12
c12 copied to clipboard
option to fail if config not exists
trafficstars
Environment
Node v22.5.1
Reproduction
const { config } = await loadConfig({ configFile: 'THIS_FILE_DOESNT_EXIST.ts' })
console.log('loaded config: ', config)
Describe the bug
When loading a config, there isn't a way, as far as I can tell to know whether the config file was loaded or not:
The config file doesn't exist, nor does loadConfig raise an error about it. I would think that there should be a guarantee that the config was loaded after calling loadConfig or indicate that the config file failed to load.
Additional context
No response
Logs