You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because I am not looking to implement my own loader, I need to dig into the defaultLoaders object to get at function I need. It's buried pretty deep in there.
Having to use bracket notation to reference the function is also less-than-ideal
I'm not sure what the impetus was behind changing this, but a suggestion to make this use case more ergonomic would be a nice shortcut like so:
import{cosmiconfig}from'cosmiconfig';cosmiconfig(namespace,{loaders: {noExt: '.js'// use the default .js loader}});
This should work with custom loaders:
import{cosmiconfig}from'cosmiconfig';import{myLoader}from'somewhere';cosmiconfig(namespace,{loaders: {'.js': myLoader,noExt: '.js'// use myLoader}});
Alternatively, expose the default loader functions at the module level, as previously named in v5.x; loadJson, loadYaml, etc.
The text was updated successfully, but these errors were encountered:
I want to use the JS loader for files without extension.
Before v6:
After:
defaultLoaders
object to get at function I need. It's buried pretty deep in there.I'm not sure what the impetus was behind changing this, but a suggestion to make this use case more ergonomic would be a nice shortcut like so:
This should work with custom loaders:
Alternatively, expose the default loader functions at the module level, as previously named in v5.x;
loadJson
,loadYaml
, etc.The text was updated successfully, but these errors were encountered: