Open josh-hemphill opened 1 year ago
rc-config-loader treat JS as CommonJS. https://github.com/azu/rc-config-loader/blob/c4e335c2c02d347ef06f8cde9eb6efd216c0537a/src/rc-config-loader.ts#L171-L172C16
I have a feeling that if JS is to be treated as an ECMAScript Module, Dynamic Import will probably be required. It means that require Async API. Also, It looks like VM APIs require async api.
Seems difficult to support right away. rc-config-loader aim to get Sync APIs.
FYI: cosmiconfig will support ESM. https://github.com/davidtheclark/cosmiconfig/pull/283
When loading
*rc.js
files that containexport const
orexport default
results in failing with errors.