I've started using ESM in a static website builder too [1]. It works, kinda.<p>Problems that I encountered:<p>To get `__dirname`, you have to do an awkward workaround using path and url [3].<p>For npm modules that implement a path e.g. `@lib/method`, the import of this currently isn't allowed in node without a flag.<p>For ESM incompatible modules, a createRequire [2] function is available to get the old `require` syntax.<p>For import statements, the cache cannot be deleted yet [4].<p>Overall, I'm please to see that nodejs will soon be ESM compatible. All changes that have been made look reasonable and useful to me.<p>In fact, I now often get the pleasurable "wow that makes sense" feeling when using node. It has has great docs, nice new features like worker_threads and it's productive for me. I'm a fan!<p>1: <a href="https://github.com/TimDaub/kloi" rel="nofollow">https://github.com/TimDaub/kloi</a><p>2: <a href="https://nodejs.org/api/module.html#module_module_createrequire_filename" rel="nofollow">https://nodejs.org/api/module.html#module_module_createrequi...</a><p>3: <a href="https://stackoverflow.com/questions/46745014/alternative-for-dirname-in-node-when-using-the-experimental-modules-flag" rel="nofollow">https://stackoverflow.com/questions/46745014/alternative-for...</a><p>4: <a href="https://github.com/nodejs/modules/issues/307" rel="nofollow">https://github.com/nodejs/modules/issues/307</a>