rc-config-loader
rc-config-loader copied to clipboard
Support ESM `"module":true` projects
When loading *rc.js files that contain export const or export default results in failing with errors.
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