Seems like a bad idea to support both. Encourages bad behavior and half-ass code. I've had no problem moving codebases to es6 without a ton of effort.
Maybe at most, hide the capability behind an execution flag.
Maybe at most, hide the capability behind an execution flag.
The only solution to this problem is to upgrade require work for importing ESM. Once that is implemented ESM will become the natural choice for those publishing libraries. Until that happens library authors are going to continue to use CJS so their libraries are available to everyone.
Node 10 was truly the last LTS that had zero ESM support, and that support ended 2 and a half years ago.