4 ms·
ESM modules are literally only downsides and workarounds, there is absolutely no user benefit at the moment, why would anyone adopt this technology other than a
by anaisbetts 6y ago
ESM modules are literally only downsides and workarounds, there is absolutely no user benefit at the moment, why would anyone adopt this technology other than a standards board saying "You Should Do It"
- ratww 6y agoQuite the contrary. In the browser, workarounds have always been the other stopgap solutions, like script concatenation, require.js, and bundlers like Webpack. With ES6 modules, bundlers and transpilers are not mandatory anymore for a large part of modern JS development. This is a good thing, as they were a giant source of complexity.
- londons_explore 6y agoSetting up a project that could either be bundled with webpack et-al, or simply hosted direct on GitHub proved tricky!
- bwindels 6y agoOne reason is that it allows to run the same code in the browser and in node without any transpilation.
- mschuetz 6y agoI absolutely love ESM modules, pretty much the best thing since sliced bread. Node.js is really botching it, though, with the requirement to use the mjs extension. It makes it very awkward and cumbersome to use the same code in the browser and node.
- Zardoz84 6y agoyou not need to use .mjs extension if you setup correctly package.json