v2.0.5 Fixes async loaders π user defined ESM support
Thanks to @michael42 who reported and fixed a bug for async loaders in lilconfig
function π
You can now add support to ESM configs by providing a custom loader
import {lilconfig} from 'lilconfig';
const loadEsm = filepath => import(filepath);
lilconfig('myapp', {
loaders: {
'.js': loadEsm,
'.mjs': loadEsm,
}
})
.search()
.then(result => {
result // {config, filepath}
result.config.default // if config uses `export default`
});