Remix.run Logo
ItsHarper 4 days ago

It's possible, but it can be weird and difficult: https://nodejs.org/docs/latest-v17.x/api/esm.html#esm_common...

Thankfully, actively-maintained CommonJS-only packages are quite rare by this point (in my experience).

> our downstream NPM consumers wouldn't be able to consume EJS

Node.js 20.17 and later supports loading ESM using `require()`: https://nodejs.org/api/modules.html#loading-ecmascript-modul...

The next version of Babel (currently in beta) is even going ESM-only.

3 days ago | parent [-]
[deleted]