CommonJS is hurting JavaScript
Does anyone have a detailed understanding of why CommonJS (and its async incarnation, AMD) were not adopted by browsers?<p>I do much like the `import` syntax personally and its a little cleaner to read, but CommonJS and AMD were the undisputed winners of the module format until ES Modules were born. Not that I have a problem with ES Modules, I don&#x27;t, however I am interested in what was so insufficient about the preceding formats that we couldn&#x27;t have standardized on them<p>EDIT: I know about the deal with CommonJS being synchronous. That isn&#x27;t per se an issue I don&#x27;t think, esp. because AMD built on top of CommonJS primitives, and with minimal refactoring CommonJS code could be used in the browser when defined this way if asynchronicity is a must. Generally, what I &quot;imagine&quot; browsers doing with CommonJS is making the `require` calls async in the background (IE non visible to developers) so they can resolve the modules then parse the code. This isn&#x27;t terribly different from how import statements work today.<p>I&#x27;m wondering why we didn&#x27;t undertake the work to just improve the existing format, more or less.<p>EDIT 2: I&#x27;m interested from a historical perspective. I think ESM is the right choice and 100% the future.