2 ms·
It matters for things like testing, module resolution and typescript. ESM runtimes are different, most people use ESM syntax with commonjs module resolution (in
by Chyzwar 3y ago
It matters for things like testing, module resolution and typescript. ESM runtimes are different, most people use ESM syntax with commonjs module resolution (index files, extensionless imports, babel) but this is not compatible with node.js ESM (lack of index files, required file extension) [1]
[1] https://nodejs.org/api/esm.html#differences-between-es-modules-and-commonjs https://nodejs.org/api/esm.html#differences-between-es-modul...
> I have no idea how ESM syntax in my apps works and I hope that I'll never know. It just works.
Once you manage a big enough application, you will know because shit shine through a lot. I spend countless hours to work around ESM issues at work (1mil LoC).